Cpplint header guard error

cpplint gives me the following errors for one of my test files:

test/unit/math/prim/mat/vectorize/expect_prim_binary_std_vector_value.hpp(1):  Lines should be <= 80 characters long  [whitespace/line_length] [2]
test/unit/math/prim/mat/vectorize/expect_prim_binary_std_vector_value.hpp(2):  Lines should be <= 80 characters long  [whitespace/line_length] [2]

However, lines 1 and 2 are the following:


I’m not sure how I can shorten my header guard to be under 80 characters. Is it possible to change cpplint to ignore checking the length of header guards?

I’m on my phone and unfortunately it’s easier to find Wikipedia that the actual doc.

See: https://en.m.wikipedia.org/wiki/Cpplint

Search for “NOLINT”.

Although, since it’s for a test file, you could probably just change the header guard. The tests don’t need to be as consistent with the guards.

Thanks, Daniel. Then, should cpplint be changed to avoid checking header guards? Even if it’s a test, I like using the full file path and file name as a header guard to avoid duplicate header guard.

No, I don’t think we should be changing our best practices that apply everywhere on the first exception. If it happens a few more times, we should start considering it.

But… technically, I don’t know if we can skip header guards.

And there’s already a mechanism in place to suppress the warning in cpplint.

Also, @seantalts is thinking about removing a folder level for all the math library. That might make this a little better.

The conflict is full path encoding vs. 80 characters. Ideally, we’d check the path was encoded in the header guard and then we’d ignore the line length. I can imagine that’s not so easy to encode, so I don’t care what the workaround is.

4 characters!

Ha! Good point.