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

Terraform-tflint command line arguments have changed #2024

Closed
4 of 7 tasks
arcsteveio opened this issue Jul 12, 2023 · 1 comment · Fixed by #2041
Closed
4 of 7 tasks

Terraform-tflint command line arguments have changed #2024

arcsteveio opened this issue Jul 12, 2023 · 1 comment · Fixed by #2041

Comments

@arcsteveio
Copy link

Thank you for taking the time to report an issue and improve Flycheck. This template is for actual bugs you observed. If you have trouble setting up Flycheck, or if you have a question, please use the relevant issue template instead.

Checklist

  • I have checked existing issues for potential duplicates before creating this one.
  • I have read the Troubleshooting guide.

Bug description

The latest version of tflint 0.47.0 changed how the command line arguments work such that it no longer accepts a file to lint from the command line. Instead you need to prefix the files with a --filter.

Here's the output from flycheck-compile:

-*- mode: compilation; default-directory: "~/dev/examples/storage/s3/" -*-
Compilation started at Wed Jul 12 12:44:27

/usr/local/bin/tflint --format\=json /Users/arcsteveio/dev/examples/storage/s3/main.tf
{"issues":[],"errors":[{"message":"Command line arguments support was dropped in v0.47. Use --chdir or --filter instead.","severity":"error"}]}
Compilation exited abnormally with code 1 at Wed Jul 12 12:44:27

If I take that same command and put a --filter in front of the file it appears to work fine:

❯ /usr/local/bin/tflint --format\=json --filter=/Users/arcsteveio/dev/examples/storage/s3/main.tf
{"issues":[],"errors":[]}%

Steps to reproduce

Assuming Flycheck and tflint are installed.

Steps to reproduce the behavior:

  1. Open a Terraform file.
  2. Change the file and save it.
  3. See error:
Suspicious state from syntax checker terraform-tflint: Flycheck checker terraform-tflint returned 1, but its output contained no errors: {"issues":[],"errors":[{"message":"Command line arguments support was dropped in v0.47. Use --chdir or --filter instead.","severity":"error"}]}
Try installing a more recent version of terraform-tflint, and please open a bug report if the issue persists in the latest release.  Thanks!

Expected behavior

Flycheck uses tflint and marks up my buffer with handy errors to fix.

Screenshots

n/a

System configuration

First checker to run:

  terraform
    - may enable:    yes
    - executable:    Found at /usr/local/bin/terraform
    - next checkers: terraform-tflint

Checkers that may run as part of the first checker's chain:

  terraform-tflint
    - may enable: yes
    - may run:    t
    - executable: Found at /usr/local/bin/tflint

Flycheck Mode is enabled.  Use C-u C-c ! x to enable disabled
checkers.

--------------------

Flycheck version: 33snapshot (package: 20230306.414)
Emacs version:    28.2
System:           x86_64-apple-darwin22.5.0
Window system:    ns

Emacs configuration:

  • Plain Emacs / Custom configuration
  • Spacemacs
  • Doom Emacs
  • Other shared configuration

Additional notes

Add any other context about the problem here.

@scop
Copy link
Contributor

scop commented Jul 14, 2023

Some background info and details on the change at terraform-linters/tflint#1687

dod38fr pushed a commit to dod38fr/flycheck that referenced this issue Nov 6, 2023
Closes: flycheck#2024

tflint can no longer be run on individual files. With this commit,
tflint is run on all files of the directory of the buffer file.
dod38fr added a commit to dod38fr/flycheck that referenced this issue Nov 6, 2023
Closes: flycheck#2024

tflint can no longer be run on individual files. With this commit,
tflint is run on all files of the directory of the buffer file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants