-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNORE_GITIGNORED_FILES not applied for cfn-lint #2955
Comments
@ashokm that's strange, cfn-lint is called with list_of_files so .gitignore files should be indeed ignored (https://megalinter.io/latest/descriptors/cloudformation_cfn_lint/#how-the-linting-is-performed ) Please could you run your workflow with LOG_LEVEL: DEBUG so we can investigate ? |
Any specific part of the output you're interested in?
|
I think this line helps :) Excluding .gitignored files [10772]: /tmp/lint/bin/blah-cdk-stack.d.ts, /tmp/lint/bin/blah-cdk-stack.js, /tmp/lint/cdk.out/asset.099a3112386fa620b3069790dcf92c8e64bb5341760a8b0a76bfa843f8ad41df/aws-sdk-v2-handler.js, /tmp/lint/cdk.out/asset.099a3112386fa620b3069790dcf92c8e64bb5341760a8b0a76bfa843f8ad41df/aws-sdk-v3-handler.bundled.js, /tmp/lint/cdk.out/asset.099a3112386fa620b3069790dcf92c8e64bb5341760a8b0a76bfa843f8ad41df/index.js, /tmp/lint/cdk.out/asset.099a3112386fa620b3069790dcf92c8e64bb5341760a8b0a76bfa843f8ad41df/shared.js, /tmp/lint/cdk.out/asset.b992a5b1efd6715c28d74eda79615c6b4c3cf54e6364f2b2166dacf0f6c68602/update-blah-ip-set.py, /tmp/lint/cdk.out/cdk.out, /tmp/lint/cdk.out/manifest.json, /tmp/lint/cdk.out/tree.json, /tmp/lint/cdk.out/blah-acl-dev.assets.json, /tmp/lint/cdk.out/blah-acl-dev.template.json, /tmp/lint/lib/blah-cdk-stack-stack.d.ts, /tmp/lint/lib/blah-cdk-stack-stack.js, /tmp/lint/node_modules/.bin/acorn, /tmp/lint/node_modules/.bin/browserslist, /tmp/lint/node_modules/.bin/cdk, /tmp/lint/node_modules/.bin/esparse, /tmp/lint/node_modules/.bin/esvalidate, /tmp/lint/node_modules/.bin/import-local-fixture, /tmp/lint/node_modules/.bin/jest, /tmp/lint/node_modules/.bin/js-yaml, I check ! |
@ashokm I think i got it, PR on the way :) |
@ashokm please could confirm it's ok with beta version ? |
Hi @nvuillam, I can confirm that the problem no longer exists in the latest Tested
|
@ashokm perfect, thanks for the feedback :) |
Hope you have a speedy recovery 🚀 |
Looks like it's broken again, or was never fixed.
$ grep .vscode .gitignore
.vscode-test/ |
@burner1024 if you want to ignore files with jscpd, you need to update .jscpd.json as this is not a linter that takes a list of files as input :) |
I just ran the command and expected |
We could indeed update the documentation to precise that it only applies to linters that works with list of files mode (and not run without list of files on the repository root) Most of linters handle by themselves to ignore files in .gitignore, but some of them like JSCPD do not, as in the example of our internal jscpd documentation -> https://megalinter.io/latest/descriptors/copypaste_jscpd/ Please feel free to post an issue on jscpd repo to request such enhancement :) |
I see, thank you for explanation. |
Describe the bug
The documentation states that the
IGNORE_GITIGNORED_FILES
env var has a default setting oftrue
and that:This has been working as expected in v6, but has stopped working when v7 was released.
After v7, we see cfn-lint not behaving as expected and it is now including directories that are set in
.gitignore
.To Reproduce
For a CDK-based project as an example, add
cdk.out
to .gitignore in the project repository.Run MegaLinter v7 (running v7.3.0 at time of writing).
You'll see in the output (in Azure Pipelines in this case) that
/tmp/lint/cdk.out/manifest.json, /tmp/lint/cdk.out/tree.json
etc are listed as being .gitignored in this line:However, after that, these files are still included in the linting scan:
Additional context
mega-linter.yml
configuration file is being used.cfnlintrc.yml
configuration file is being usedThe text was updated successfully, but these errors were encountered: