cppclean
cppclean copied to clipboard
Headers named '*.hxx' are ignored
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.
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.
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.
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.
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).
Or perhaps make it an option that can be configured?