Drop -c short flag from --config-file to fix duplicate parameter warning - #5279
Open
MGpromax wants to merge 1 commit into
Open
Drop -c short flag from --config-file to fix duplicate parameter warning#5279MGpromax wants to merge 1 commit into
MGpromax wants to merge 1 commit into
Conversation
The new --config-file option added in 1c04c47 declared -c as its short flag, colliding with the long-standing -c/--copyright option from the copyright scanner plugin. click warns about the duplicate parameter on every invocation: UserWarning: The parameter -c is used more than once. Remove its duplicate as parameters should be unique. Keep -c for --copyright and drop the short flag from --config-file, which has not shipped in a release yet. Regenerate the help test fixtures and update the docs pages that embed the help text. Reference: aboutcode-org#5265 Signed-off-by: Manoj Gowda <manojgowdabs18@gmail.com>
MGpromax
force-pushed
the
fix-config-file-c-collision
branch
from
August 24, 2026 08:05
3b1a945 to
61483ed
Compare
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.
Fixes #5265
As suspected in the issue, commit 1c04c47 (the new
--config-fileoption) is the culprit: it declared-cas its short flag, which collides with the long-standing-c/--copyrightoption from the copyright scanner plugin (src/cluecode/plugin_copyright.py). click then emits theUserWarning: The parameter -c is used more than onceon every invocation.Fix: drop the
-cshort flag from--config-file, keeping-cfor--copyrightas documented everywhere. Since--config-filehas not shipped in any release yet (no tag contains 1c04c47), this is not a breaking change for released users.Also updated:
tests/scancode/data/help/help.txtregenerated withSCANCODE_REGEN_TEST_FIXTURES(the wholecore:group re-flows because that row set the option column width); the same regeneratedcore:block applied tohelp_linux.txtdocs/source/rst-snippets/cli-core-options.rst,docs/source/reference/scancode-cli/cli-help-text-options.rst)Validation:
scancode -c --json-pp out.json <file>no longer emits the warning and the copyright scan workspytest tests/scancode/test_cli.py tests/scancode/test_ignore.pypasses locally (including the--config-filetests added with the original commit)Tasks