jscpd: .jscpd.json does not ignore file(s)
Describe the bug
Created .jscpd.json file in the project root as it is described here. In the section “ignore” left only "**/*.md"
Still getting failure with error message ERROR: jscpd found too many duplicates (35.55%) over threshold (0%)
To Reproduce Steps to reproduce the behavior:
- Go to branch
https://github.com/aregtech/areg-sdk/tree/20211009-readme - Check the content of file .jscpd.json
- Open to edit file README.md. Type anything is some place and commit.
- Wait a little bit, go to Action menu and see the result.
Expected behavior Regardless it is absolutely the root cause of the failure, but my expectation is that mega-linter ignores all *.md files.
Screenshots


Desktop (please complete the following information):
- OS: Ubuntu
- OS Version: 20.04.3, LTS
- NodeJS Version: I have no idea, i don’t use JS
- jscpd version: super-linter:v4.8.1
Run github/super-linter@v4
/usr/bin/docker run --name ghcriogithubsuperlinterv481_686139 --label fa4e14 --workdir /github/workspace --rm -e VALIDATE_ALL_CODEBASE -e DEFAULT_BRANCH -e GITHUB_TOKEN -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/areg-sdk/areg-sdk":"/github/workspace" ghcr.io/github/super-linter:v4.8.1
--------------------------------------------------------------------------------
Additional context

About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 4
- Comments: 15 (7 by maintainers)
Aha! I’ve figured out the issue. If you run
jscpdlikejscpd --pattern 'src/**/*'and then you have an ignore pattern likesrc/app/data/**/*, jscpd will incorrectly resolvesrc/appas relative to (I believe) the source pattern, vs the root. But if you change the pattern to**/app/data/**/*it works.I believe this is a bug in
jscpd.Could you confirm if this issue is affecting me? I started using this action today and I want to exclude directories from being validated:
It seems regardless of the pattern I use I am unable to exclude files, I am not sure if this is related to this, or if I am simply doing something wrong.
will check and fix the issue, thank you for the report
Hello this still seem to be an issue, I am using super-linter and getting several
Clone foundserrors in a yaml file. All attempts to ignore the file with a.jscpd.jsonfailed, is there any solution/workaround to successfully ignore a .yaml-file???First try:
Second try:
Never mind. I found how I can disable jcpd in superlinter:
I also confirm the workaround of @matthew-dean changing the configuration like so removes the report:
However, I assume this is not exactly what we need, as it will match any
servicesbase path, not only the one fromsrc.I’m also seeing an issue where
ignorefile patterns are not ignored.So right now there is no way to ignore files? This makes superlinter unusable for me. Or am I missing something?
@Kurt-von-Laven will try to use the lib
I suspect these matters as well as #466 may all be addressed in one shot by replacing the buggy gitignore-to-glob with
git check-ignoreand not bothering to support thegitignorefeature when Git is not installed. Alternatively, it might be a matter of switching to parse-gitignore@v0.5.1?