Skip to content

Several false positives for whitespace/indent_namespace #401

Description

@gmackey

Attached is a file that has some simple examples that cause false positives for indenting inside a namespace. These all worked with 1.6.1. They appeared when upgrading to 2.0.2.

example.cpp

The content of the file is pasted here, too:

// Copyright 2025 NoSuchCompany

#include <cstdint>
#include <memory>
#include <vector>

namespace test {

// After assignment operator.
constexpr int64_t kTestConstant =
    123;

using NewInt =
    int64_t;


// Inside braces.
enum class TestEnumType : uint8_t { kOne,
                                    kTwo,
                                    kThree };


// Inside template.
template <typename T>
class TestVector : std::vector<
    T> { };

template <typename Type1,
          typename Type2>
void TestFunc(const Type1 &var1, Type2 &var2);

using TestVector = std::vector<
                       int64_t>;

template <typename T>
using TestVectorPointer = std::shared_ptr<
        std::vector<
            T>>;

}  // namespace test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions