bflad / tfproviderlint

Terraform Provider Lint Tool
Mozilla Public License 2.0
136 stars 25 forks source link

Ability to run lint against a subset of changes #262

Open jacobbednarz opened 1 year ago

jacobbednarz commented 1 year ago

Community Note

Description

I maintain an older provider that relies on tfprovidferlint however, I have to disable some of the more useful checks due to large parts of the codebase not ever being touched. While we have a plan to address these older parts, I'd still like to find a way to run all the lint rules on new code to prevent those problems creeping in.

This would be a similar request to golanglint-ci's new or new-from-rev configuration - https://golangci-lint.run/usage/configuration/.

I used to have a workaround that relied on git diff-tree, matching all the files that changed between commits and making sure we loaded all the base files however, that got pretty unmanageable. So I thought it's time to see if there is a way to include this in the tool itself.

New or Affected Checks(s)

n/a

Flagged Provider Code

n/a

Passing Provider Code

n/a

References

Could potentially use build tags (as mentioned in #257) if they worked.