Skip to content

False positive for top-level header #375

Open

Description

@stur86

The check for build/include_subdir only checks that a subdirectory is present at all; it does not check that it's complete or correct, and it does not allow for top level headers that simply don't have a subdirectory. E.g. if the file structure was

src
|
|-- main.cpp
|
|-- utils.hpp

and we had a main.cpp like

#include "utils.hpp"

int main() {
}

this would raise an error, even though everything is correct.

Activity

  1. A-lexisL commented on Oct 25, 2025

    @A-lexisL

    Did you encounter this error? Include the directory when naming header files [build/include_subdir]?
    I have some subdirectories each corresponding to different subprojects, and including header files in these subprojects will raise this error even though I run cpplint just under the very subdirectory.
    If I include the header files like ./feature1.h in feature1.c, cpplint will raise should include its header file . Relative paths like . and .. are not allowed. [build/include].
    These two errors don't make sense as my root directory should be the subdirectory.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions