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

cmd: Allow --chdir and --recursive to be used together #2079

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Jun 30, 2024

Fixes #2051

Previously, --chdir and --recursive could not be used together.

$ tflint --chdir=infra --recursive
Failed to find workspaces; cannot use --recursive and --chdir at the same time

This is because the --recursive was originally designed as --chdir for multi-directory #1612 #1622
Given this background, using them together was out of scope. Also, it is not obvious whether --recursive or --chdir takes precedence, which can lead to strange behavior when --recursive takes precedence.

However, given that terraform -chdir=infra fmt --recursive is a valid command, it is natural to expect similar behavior. In terraform fmt, -chdir takes precedence and recurses into the directory after the move. TFLint follows this behavior.

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.

Allow use of --chdir and --recursive together
1 participant