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

Allow serving custom RuleSet by plugins #72

Merged
merged 1 commit into from
Nov 3, 2020
Merged

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Oct 31, 2020

This PR changes the tflint.Ruleset struct to the interface. This allows each plugin to serve a custom ruleset.

The previous behavior can be reproduced by using the tflint.BuiltinRuleSet. If you do not need plugin-specific processing, please use tflint.BuiltinRuleSet directly.

Custom rulesets can be used by declared a RuleSet with a tflint.BuiltinRuleSet embedded in the plugin and serving it. By overwriting the following method, you can insert the process specific to the plugin.

  • ApplyConfig
    • The argument tflint.Config contains the hcl.Body defined in the "plugin" block. You can handle plugin-specific configurations by decoding this with a custom ruleset.
  • Check
    • You can generate custom configurations built with ApplyConfig, custom runners that wrap provider API clients, etc., and apply them to plugin rules.

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.

1 participant