pre-commit-java icon indicating copy to clipboard operation
pre-commit-java copied to clipboard

CLI options for CPD not working

Open jonyscathe opened this issue 9 months ago • 0 comments

With the example given in the readme of:

    - id: cpd
      args: ["--minimum-tokens", "50"]

I get the following output:

pre-commit run -a cpd -vv
cpd......................................................................Passed
- hook id: cpd
- duration: 1.37s

[ERROR] No such file --minimum-tokens
[ERROR] No such file 50

Note that this still passes despite the errors.

If I try an older version (v0.3.1) it still doesn't work, but I get a different error:

pre-commit run -a cpd -vv
cpd......................................................................Failed
- hook id: cpd
- duration: 1.27s
- exit code: 1

Can only specify option --minimum-tokens once.
Run with --help for command line help.

I would also like to run cpd over python rather than java. I would have assumed that something like:

  - repo: https://github.com/gherynos/pre-commit-java
    rev: v0.4.2
    hooks:
      - id: cpd
        args: ["--minimum-tokens", "50", "--language", "python"]
        files: py$ 

should work, but gets similar issues with No such file --language, No such file python or I did also manage to get it to say Can only specify option --language once. which might be because --language java is hardcoded in run_cpd.sh

jonyscathe avatar May 15 '24 02:05 jonyscathe