Skip to content

Issue#462#704

Open
RichardSimison wants to merge 4 commits intoboyter:masterfrom
RichardSimison:Issue#462
Open

Issue#462#704
RichardSimison wants to merge 4 commits intoboyter:masterfrom
RichardSimison:Issue#462

Conversation

@RichardSimison
Copy link
Copy Markdown
Contributor

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.

@pr-insights pr-insights Bot added M/complexity Normal or medium complexity S/size Small change labels May 6, 2026
Copy link
Copy Markdown
Owner

@boyter boyter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small fix requested, which I think should be pretty easy.

Comment thread processor/processor.go
}
}
}
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

M/complexity Normal or medium complexity S/size Small change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants