Skip to content

Fix duplicate -c click option parameter conflict - #5273

Open
eshaanag wants to merge 2 commits into
aboutcode-org:developfrom
eshaanag:fix/5265-config-file-parameter-conflict
Open

Fix duplicate -c click option parameter conflict#5273
eshaanag wants to merge 2 commits into
aboutcode-org:developfrom
eshaanag:fix/5265-config-file-parameter-conflict

Conversation

@eshaanag

Copy link
Copy Markdown

Fixes #5265

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)

Description

This PR resolves the UserWarning: The parameter -c is used more than once Click error reported in #5265.

The issue was caused by two options registering the same short option -c:

  1. --config-file registered with -c in src/scancode/cli.py.
  2. --copyright registered with -c in src/cluecode/plugin_copyright.py.

Since -c has historically been the shortcut for --copyright in scancode and is extensively documented, we resolved the conflict by removing the short flag -c from --config-file, leaving it as --config-file.

Changes

  • Removed -c short option from the --config-file declaration in src/scancode/cli.py.
  • Updated all related help text golden files: help.txt and help_linux.txt.
  • Updated the CLI reference and core options documentation snippets.
  • Commits are signed off (DCO) and GPG-signed.

Remove the short option '-c' from the --config-file option registration. This resolves a conflict with the --copyright short option '-c', which triggered duplicate parameter registration warnings under click.

Signed-off-by: Eshaan Agrawal <agrawaleshaan12@gmail.com>
Catch ValueError raised when calling signal.signal from a non-main thread or non-main interpreter context (e.g. sub-interpreters on Python 3.14+). Falls back to synchronous execution without a timeout.

Signed-off-by: Eshaan Agrawal <agrawaleshaan12@gmail.com>
@eshaanag
eshaanag force-pushed the fix/5265-config-file-parameter-conflict branch from 25ccb9f to 43f02c6 Compare August 19, 2026 13:12
@AyanSinhaMahapatra

Copy link
Copy Markdown
Member

@eshaanag thanks for the PR, you've added interrupt related changes which are unrelated and should have been a seperate PR, so we've merged #5279 instead.

Could you update the PR description and title to address only the signal inturrupt related changes? Also I've not seen this failure consistently but only happening sometimes, can you explain that? Like for example all tests passed in https://github.com/aboutcode-org/scancode-toolkit/runs/98624035607 without this.

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."

2 participants