Skip to content

Drop -c short flag from --config-file to fix duplicate parameter warning - #5279

Open
MGpromax wants to merge 1 commit into
aboutcode-org:developfrom
MGpromax:fix-config-file-c-collision
Open

Drop -c short flag from --config-file to fix duplicate parameter warning#5279
MGpromax wants to merge 1 commit into
aboutcode-org:developfrom
MGpromax:fix-config-file-c-collision

Conversation

@MGpromax

Copy link
Copy Markdown

Fixes #5265

As suspected in the issue, commit 1c04c47 (the new --config-file option) is the culprit: it declared -c as its short flag, which collides with the long-standing -c/--copyright option from the copyright scanner plugin (src/cluecode/plugin_copyright.py). click then emits the UserWarning: The parameter -c is used more than once on every invocation.

Fix: drop the -c short flag from --config-file, keeping -c for --copyright as documented everywhere. Since --config-file has 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.txt regenerated with SCANCODE_REGEN_TEST_FIXTURES (the whole core: group re-flows because that row set the option column width); the same regenerated core: block applied to help_linux.txt
  • the two docs pages that embed the help row (docs/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 works
  • pytest tests/scancode/test_cli.py tests/scancode/test_ignore.py passes locally (including the --config-file tests added with the original commit)

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable) -- not applicable, the option is unreleased

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
MGpromax force-pushed the fix-config-file-c-collision branch from 3b1a945 to 61483ed Compare August 24, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Odd click warning: "UserWarning: The parameter -c is used more than once."

1 participant