Skip to content
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

Question about Filenames to scan. #208

Open
alexandresavicki opened this issue Jun 30, 2020 · 1 comment
Open

Question about Filenames to scan. #208

alexandresavicki opened this issue Jun 30, 2020 · 1 comment

Comments

@alexandresavicki
Copy link

alexandresavicki commented Jun 30, 2020

I'm trying to run config-lint on my terraform configuration files and I came across a possible problem.

If i run terraform init before running config-lint, a ocult directory .terraform will be created.

So when i run config-lint against my terrafom files, the config-lint will be scan all the *.tf files inside .terraform directory.

I'm trying to use the exclude and exclude-from command line parameters, but it doesn't seem to work recursively inside a directory:

Command line example.:
config-lint -exclude .terraform/\* -debug -rules testerules.yml .

Exclude patterns: [.terraform/*]
Excluding file: .terraform/terraform.tfstate using pattern: .terraform/*
Filenames to scan: [.atlantis-enabled .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/.chglog/CHANGELOG.tpl.md .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/.chglog/config.yml .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/.editorconfig .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/.gitignore .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/.pre-commit-config.yaml .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/CHANGELOG.md .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/LICENSE .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/Makefile .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/README.md .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/examples/github-repository-webhook/README.md .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/examples/github-repository-webhook/main.tf .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/examples/github-repository-webhook/outputs.tf .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/examples/github-repository-webhook/terraform.tfvars.sample .terraform/modules/atlantis/terraform-aws-atlantis-2.20.0/examples/github-repository-webhook/variables.tf

It's possible ignore this .terraform/* directory from files to scan?

@lijok
Copy link

lijok commented Sep 12, 2020

Seems like it's using string.Match to do the matching, which uses shell syntax for the matching
This should move to using a regex or something to allow for usable exclude filters

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

No branches or pull requests

2 participants