-
Notifications
You must be signed in to change notification settings - Fork 5k
Add .gitattributes override mention when returning the strategy #7600
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
base: main
Are you sure you want to change the base?
Conversation
|
I think it would be clearer to users if we reported "(overridden by [path/to/.gitattributes])" instead of merely "GitAttributes" (as there's really only one that affects Linguist's classification). So instead of treating |
|
Sounds good, I've made the change to display the information like so:
This change means that detection has to take place even when there is an override in order to determine what strategy would be used. However, the changes in e879628 also introduce a check on Adding the |
lildude
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good idea to me. Can you please also update the README.md to document and show the output this change introduces.
In the latest commits, I've added:
|
This pull request introduces a note mentioning
.gitattributesoverrides when using the--strategiesoption. It also adds small integration tests to verify that CLI behavior reflects these changes while preserving the normal behavior when--strategiesis not specified.Language detection improvements:
linguist-languageattribute is present in the.gitattributesfile for the analyzed file, a note is added to mention the override.Testing and instrumentation enhancements:
test_basic_instrumenter.rbto verify that the detection strategy and language are correctly tracked when.gitattributesoverrides are present and the strategy information is displayed correctly.CLI integration and coverage:
test_cli_integration.rbsuite with tests for CLI flags (--strategies,--breakdown,--json) to ensure that.gitattributesoverrides are detected, the correct strategy info is reported, and JSON output remains accurate.