-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update rules to utilize configurations per rule #1
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- allow to inject rule's configurations with the rule_options argument given to tests.common.runner.get_collection. - add some test cases to confirm the above works
…ions - tests.common.testcases.BaseTestCase.get_runner: create runner on demand when running linter, and allow to configure the behavior of the rule with the config argument - tests.common.testcases.RuleTestCase.{run_playbook,lint}: allow to pass and set rule's configurations - tests.common.testcases.CliTestCase: simplify and allow to configure the rule with configuration file
… 'debug' Extend to allow to load and utilize rule's specific configurations (rules.debug.enabled) for custom rule 'debug' to change its behavior. - rules.DebugRule.DebugRule: now it can be enabled with .ansible-lint configuration (rules.debug.enabled) instead of an environment variable. - tests.TestDebugRule: follow changes in the above class and inject its configuration as needed
Change to allow listing modules to block for the 'blocked_modules' rule in ansible-lint's configuration file such like the following rules: blocked_modules: blocked: - shell - ping - rules.BlockedModules.BlockedModules: now it can be configured to block modules in .ansible-lint configuration (rules.blocked_modules.blocked) instead of an environment variable. - tests.TestBlockedModules: follow changes in the above class and inject its configuration as needed.
…n.testcases.BaseTestCase
… get the rule instance
Utilize configurations for rules instead of environment variables.
This pull request introduces 7 alerts and fixes 1 when merging 0d1aff1 into d624484 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 7 alerts when merging 0d1aff1 into 3419b87 - view on LGTM.com new alerts:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because github.com/ansible/ansible-lint#1534 was merged, we now can configure each rule by its own configurations in .ansible-lint. This change utilizes that and eliminate hacks to configure rules by environment variables.