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

Add ignore_rules and exclude_paths as inputs to the action #22

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ inputs:
version:
description: 'Version of terraform-linter to use'
default: 'latest'
ignore_rules:
description: 'Comma-separated list of rule IDs to ignore (e.g. "TF001")'
exclude_paths:
desciption: 'Comma-separated list of files or directories to exclude from linting'

runs:
using: 'composite'
Expand All @@ -44,5 +48,7 @@ runs:
shell: 'bash'
env:
LINT_PATHS: '${{ inputs.directory || inputs.paths }}'
TFLINT_IGNORE_RULES: '${{ inputs.ignore_rules }}'
TFLINT_EXCLUDE_PATHS: '${{ inputs.exclude_paths }}'
run: |-
${{ steps.download.outputs.binary-path }} lint ${LINT_PATHS}
2 changes: 2 additions & 0 deletions internal/cli/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (c *LintCommand) Flags() *cli.FlagSet {
"This option can be specified multiple times to exclude multiple paths " +
"or directories.",
Example: "<pattern>",
EnvVar: "TFLINT_EXCLUDE_PATHS",
Predict: predict.Or(
predict.Dirs(""),
predict.Files("*.tf"),
Expand All @@ -88,6 +89,7 @@ func (c *LintCommand) Flags() *cli.FlagSet {
Usage: "List of linter rules to ignore. This option can be specified " +
"multiple times to ignore multiple rules.",
Example: "<rule>",
EnvVar: "TFLINT_IGNORE_RULES",
Target: &c.ignoreRules,
})

Expand Down
Loading