Skip to content

Lint is not working for catching Namespace Indentation error #234

Closed

Description

@Yujinmon

Hello, i found some error related to indentation and it seems worth it to solve.

In google style guide, there is the contents for namespace indentation
https://google.github.io/styleguide/cppguide.html#Namespace_Formatting
Specifying 'the contents of namespace are not indented'.

For example,
image
You can see there is indent inside in namespace scope.
This is not fit to google style guide.

image This is the example of correct style refer to google style guide.

And as you can see,
image
lint is not catching!

I think it would be great that if this problem solved.
Can anyone give comments or feedback for this issue?

Thankyou!

Activity

  1. Yujinmon commented on Nov 17, 2023

    @Yujinmon
    ContributorAuthor

    There is a patch for this error, and i'm preparing for pull request.
    If anyone interested, please check the pr!

  2. jiawen commented on Jan 29, 2025

    @jiawen

    Since the update to 2.0, I'm seeing the opposite. It's overly aggressive in complaining that I content within a namespace should not be indented even though it's not (a false positive). E.g.,

    #include "gtest/gtest.h"
    
    namespace MyNamespace {
    namespace {
    
    TEST(MyTest,
         SomeVeryLongTestNameSoThatClangFormatBreaksLinesAtEightyChars) {
      // Test body.
    }
    
    }  // namespace
    }  // namespace MyNamespace
    

    cpplint complains that the line starting with SomeVeryLong..., should not be indented.

  3. aaronliu0130 commented on Jan 29, 2025

    @aaronliu0130
    Member

    @jiawen This is an old and fixed issue, and you're correct that we now have #293.

  4. jiawen commented on Feb 2, 2025

    @jiawen

    @jiawen This is an old and fixed issue, and you're correct that we now have #293.

    Ha I must be blind. I thought I looked through all issues with namespace in the title. Anyway, thanks! Looks like you just fixed #293.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions