cppclean icon indicating copy to clipboard operation
cppclean copied to clipboard

Headers named '*.hxx' are ignored

Open ZedThree opened this issue 7 years ago • 5 comments

This line explicitly ignores headers ending in ".hxx", even though they are included in the list of header extensions. Is this done on purpose? Forgive me if I'm being dim, but I had a look, and I couldn't find anything that explained why ".hxx" files are skipped.

ZedThree avatar Aug 18 '17 13:08 ZedThree

Interesting! It looks like @r-e-d added this in e7a4645fa25d7beddbfb0ff3978a6285234c6851. But I don't see a rationale for that conditional. Unless there are objections, I think we should remove the conditional.

myint avatar Aug 18 '17 15:08 myint

In a project, we include the ".hxx" at the end of the ".h". And as the ".hxx" contains templated code, it produces an erroneous "Header does not need to be #included; use a forward declaration instead".

This line is used to ignore ".hxx" for this warning.

r-e-d avatar Aug 18 '17 18:08 r-e-d

Could that behaviour be made optional, instead of default? Only it's not documented, and very surprising. I'd be happy to submit a PR for this.

Alternatively, there could be a mechanism to silence particular warnings, either through a flag to cppclean or code annotations.

Unfortunately, as it is, it makes cppclean essentially unusable for projects using ".cxx/.hxx" file extensions.

ZedThree avatar Aug 22 '17 08:08 ZedThree

I guess this line can be changed into : if filename != self.filename + 'xx':

This way it will only prevent a warning if foo.h include foo.hxx (and not regress my use case).

r-e-d avatar Aug 22 '17 14:08 r-e-d

Or perhaps make it an option that can be configured?

myint avatar Aug 25 '17 16:08 myint