google / styleguide

Style guides for Google-originated open-source projects
https://google.github.io/styleguide/
Apache License 2.0
37.47k stars 13.3k forks source link

Guard check does not follow Google Style #138

Open uilianries opened 8 years ago

uilianries commented 8 years ago

On Define Guard, the definition:

The format of the symbol name should be H.

However, if I have the follow structure:

/foo/include/internal/qux.h

The guard in qux.h would be:

#ifndef FOO_INTERNAL_QUX_H_
#define  FOO_INTERNAL_QUX_H_
#endif //  FOO_INTERNAL_QUX_H_

Although, the cpplint returns the follow error:

$ > cpplint foo/include/internal/qux.h foo/include/internal/qux.h:0: #ifndef header guard has wrong style, please use: INTERNAL_QUXH [build/header_guard] [5] foo/include/internal/qux.h:2: #endif line should be "#endif // INTERNAL_QUXH" [build/header_guard] [5] Done processing foo/include/internal/qux.h Total errors found: 1

Johnson9009 commented 8 years ago

I have meet the same problem!