Repository navigation
Detect C++ source and header extensions beyond .cpp - #44
Merged
Merged
Conversation
.cc, .cxx and .c++ now report as C++, and .hpp, .hh, .hxx and .h++ as C++ Header, a new language paralleling C Header. Only .cpp was mapped before, so a codebase using .cc and .hpp showed no C++ at all. All seven are in GCC's documented list of C++ suffixes. .h is unchanged: it is shared by C, C++ and Objective-C and cannot be resolved from the path. The changes note lists every C++ suffix considered and left unmapped, with the reason for each. The docs site counts are updated to 89 filetypes and 34 languages. Closes #43 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #43.
Summary
.cc,.cxxand.c++now report asC++..hpp,.hh,.hxxand.h++now report asC++ Header, a new language parallelingC Header..his unchanged and still reportsC Header.Only
.cppwas mapped before, so a codebase using.ccand.hppshowed no C++ at all.Before and after
file.cc,file.cxx,file.c++UnknownC++file.hpp,file.hh,file.hxx,file.h++UnknownC++ Headerfile.cppC++C++file.hC HeaderC HeaderSource
All seven are in the GCC documentation's list of C++ suffixes.
Design notes
C++ Headeris a new language name. Headers are reported separately from sources because that is what panopticas already does for C. Reporting them as plainC++was considered and rejected as inconsistent with.h..his not resolved here. It is shared by C, C++ and Objective-C; that is the subject of Proposal: disambiguate .m (Objective-C, MATLAB) and .h (C, C++, Objective-C) #40..Cand.Hare not mapped. GCC treats the capitalised forms as C++, but panopticas lowercases extensions before lookup, so they still report asCandC Header.Things to note
Testing
pytest: 757 passed. The new tests were written first and failed before the change; one asserts.hstill reportsC Header.src/tests/;panopticas assessshows each with the expected filetype.🤖 Generated with Claude Code