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

Trying to set chdir so only scans certain folders is not working #90

Open
balq60 opened this issue Mar 6, 2023 · 0 comments
Open

Trying to set chdir so only scans certain folders is not working #90

balq60 opened this issue Mar 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@balq60
Copy link

balq60 commented Mar 6, 2023

Describe the bug
I want to be able to scan folders. I have tried these settings. All of these settings fail to scan JUST the folder I set:

#EXAMPLE 1

#EXAMPLE 2

#EXAMPLE 3

#EXAMPLE 4
#This fails as well

To Reproduce
Terraform version 1.3.9

// paste code snippets here
To Trip the linter I added this in my IaC/environments/1-test folder

variable "not_used" {
  description = "To trip linters"
  type        = string
  default     = null
}

tflint...................................................................Failed
- hook id: tflint
- exit code: 2

1 issue(s) found:

Warning: variable "not_used" is declared but not used (terraform_unused_declarations)

  on IaC/environments/1-test/compute-priv-variables.tf line 183:
 183: variable "not_used" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.2/docs/rules/terraform_unused_declarations.md

**Expected behavior**
Since I am setting a chdir argument to scan the IaC/environments/2-staging/ folder (I tried without the trailing slash, fails as well)

I would NOT expect the linter to find the issue in the IaC/environments/1-test folder.

I would expect no errors reported

**Nice to have**
- [ ] Terminal output
- [ ] Screenshots

**Additional context**
I want to be able to set different exclusion per environment.  I want production to have all rules applied with lower environments I want the ability to exclude rules.  I cannot do that, since chdir is not being honored.  I submitted this bug in the tflint repo, they it was not their issue.
@balq60 balq60 added the bug Something isn't working label Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant