Issue#462#704
Open
RichardSimison wants to merge 4 commits intoboyter:masterfrom
Open
Conversation
…n used to override any internal language or augment it. To run SCC with the new flag input ./scc --languages-file custom.json (filename)
boyter
requested changes
May 7, 2026
| } | ||
| } | ||
| } | ||
| } |
Owner
There was a problem hiding this comment.
I think... this needs to come after the load, because we want to allow overriding of existing config. Part of the point being someone may want to count docstrings as code for example.
This also would allow testing differences between configs a little more easily.
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.
I created a –languages-file flag that allows users to use their own custom languages.json file to replace or augment the default json without altering the original code. The implementation involved adding a LanguagesFile global variable in processor.go, registering the flag in main.go, and adding logic at the start of ProcessConstants to read and parse the external JSON file. This merges the custom language definitions into the existing languages map of scc.
To use the feature, create a JSON file following the same structure as the built-in languages.json and pass it via the flag EX: scc --languages-file custom.json, where entries with existing language names will override the built-in definition and new names will be added as entirely new languages.