-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to merge embedded languages #105
Comments
The classification is done by pygments, so this would need to be an extra step performed by pygount. Seemingly pygments uses the convention Not high on my list of priorities but I leave it in the backlog. |
Note to self: We still need to detect C++ to be a full language, not the "+" sub-language of C. Here's a first code snipplet to derive the base language, if any. import re
_BASE_LANGUAGE_REGEX = re.compile(r"^(?P<base_language>[^+]+)\+[^+].*$")
def base_language(language: str) -> str:
base_language_match = _BASE_LANGUAGE_REGEX.match(language)
return language if base_language_match is None else base_language_match.group("base_language")
assert base_language("JavaScript") == "JavaScript"
assert base_language("JavaScript+Lasso") == "JavaScript"
assert base_language("JavaScript+") == "JavaScript+" # no actual language
assert base_language("C++") == "C++"
assert base_language("++C") == "++C" # no actual language |
…ed-languages #105 Add option to merge embedded languages
…ed-languages #105 Clean up deprecation warnings
Story
As user I want to see a single count for a base language even of there are source codes with various embedded languages so that I can get a general idea how much the base language is used independent of the embedded languages.
Example languages this is useful for: HTML, XML, JavaScript.
Goals
--merge-embedded
is specified, all source files from an embedded language count only towards the base language.Original request: Option to merge sub language
Example of output
┏━━━━━━━━━━━━━━━━
┃ Language ┃
┡━━━━━━━━━━━━━━━━
│ Python │
│ XML │
│ XML+Django/Jinja │
│ JavaScript+Lasso │
│ JavaScript │
│ Genshi │
│ SCSS
│ JavaScript+Genshi Text │
│ HTML │
│ JavaScript+Django/Jinja │
│ CSS+Lasso │
│ empty │
Can we have an option to merge result of
XML with XML+Django/Jinja + Genshi
Javascript with Javascript+Lasso + Javascript+Genshi Text + Javascript+Django/Jinja
Are maybe remove sub language classification from analysis?
The text was updated successfully, but these errors were encountered: