Skip to content

fix: treat tflint exit code 2 as failure #324

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

Merged
merged 1 commit into from
Aug 11, 2025

Conversation

bendrucker
Copy link
Member

@bendrucker bendrucker commented Aug 11, 2025

Fixes the wrapper to properly handle tflint exit codes. The wrapper was incorrectly treating exit code 2 as success.

Issue

tflint exits with code 2 when it finds issues that should cause failure (based on --minimum-failure-severity if set, or any issues if not set). The wrapper was treating this as success, which is incorrect.

Changes

  • Treat any non-zero exit code as failure (exit code 2 means "issues found that should fail")
  • Add comments documenting exit code meanings

Breaking Change

⚠️ The wrapper now correctly fails when tflint finds issues. To ignore warnings, use --minimum-failure-severity=error.

Fixes #323

BREAKING CHANGE: The wrapper now treats tflint exit code 2 (issues found) as a failure.
This aligns with tflint's behavior when using --minimum-failure-severity flag.

Previously, exit code 2 was treated as success, which prevented the wrapper from
properly respecting the --minimum-failure-severity flag introduced in tflint v0.45.0.

Fixes #323
@bendrucker bendrucker merged commit ae78205 into master Aug 11, 2025
16 checks passed
@bendrucker bendrucker deleted the fix-minimum-failure-severity branch August 11, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Running tflint with --minimum-failure-severity set lower than error does not work
1 participant