oxsecurity / megalinter

🦙 MegaLinter analyzes 50 languages, 22 formats, 21 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
https://megalinter.io
GNU Affero General Public License v3.0
1.89k stars 232 forks source link

MegaLinter Unintentionally Enforces jscpd Threshold of `0` #2450

Open Kurt-von-Laven opened 1 year ago

Kurt-von-Laven commented 1 year ago

Describe the bug Starting in v6.20.0, jscpd began failing when run via MegaLinter on repositories containing at least 1 clone even if they configured a sufficiently high threshold.

To Reproduce Steps to reproduce the behavior:

  1. Copy and paste at least a few lines of code in your repository so that you have at least 1 clone for jscpd to detect.
  2. Set a threshold of 100 in .jscpd.json so that jscpd should pass unconditionally.
  3. Run npx jscpd@3.5.3 ., and observe that jscpd passes.
  4. Run jscpd via MegaLinter v6.20.0+ or npx jscpd@3.5.3 --exitCode 1 ., and observe that jscpd fails.

Expected behavior jscpd should succeed if and only if the percentage of duplicated lines doesn't exceed the configured threshold.

Additional context This bug was introduced by uncommenting --exitCode 1 in #2329. I believe the solution is to delete these arguments; please let me know if anyone anticipates any drawbacks to this change.

nvuillam commented 1 year ago

I use jscpd a lot on my pro projects, i'll check with beta I'll downgrade devskim in another pr

jokay commented 1 year ago

I can confirm this as well.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.