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

tflint: Allow config to be merged even with initial values #1670

Merged
merged 1 commit into from Feb 5, 2023

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Feb 5, 2023

See also #1604

The tflint.Config does not have a mechanism to distinguish between undefined and initial values, and whether or not it is overwritten was determined by whether it was different from the initial value.

tflint/tflint/config.go

Lines 331 to 333 in 16e0218

if other.Module {
c.Module = true
}

However, this cannot override it to the initial value, and fails to achieve requirements like #1604.

This PR adds a flag to distinguish between undefined and initial values in tflint.Config. The tfllint.Config will only be overridden if the flag is set. With this change, the following five values can be overridden to the initial values:

  • module
  • force
  • disabled_by_default
  • plugin_dir
  • format

However, since the initial values for these values cannot be set from the CLI, the current behavior does not change.

@wata727 wata727 merged commit c8ff71c into master Feb 5, 2023
@wata727 wata727 deleted the improve_config_merge branch February 5, 2023 15:58
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.

None yet

1 participant