-
Notifications
You must be signed in to change notification settings - Fork 700
Make rule deprecated-local-action preserve module parameters #4733
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
Make rule deprecated-local-action preserve module parameters #4733
Conversation
Set this back to DRAFT as SonarCloud Code Analysis CI job doesn't like the code. I kinda agree and will try simplify the implementation |
I think the remaining CI errors are not cause by my PR, right? |
I don't think so, but you may have help us find a bug:
#4734 should fix the action test (confirmed) |
I changed the debug log statements for missing "local_action" and "module" param to assertions. Code coverage went down because of the log statements and while trying to write test fixtures I realized a missing I think the assertions are fine here to guard against implementation errors. |
The latter is only useful preventing import cycles when using custom types
@koalajoe23 Does this do everything you need now? Fun stuff. BTW, your intuition was right about needing a way to get out quick, it was part of the reason I threw in an exception, it also made adding some unit tests for the edge cases pretty straight forward with having to traverse the entire code base. |
👍 for the changes. I really like the decoupled tests and error handling! Only nitpick I have is that the transformed output should treat empty params as None - just looks much cleaner and "human". I took the liberty to just commit a fix, feel free to drop this commit if you want. Everything LGTM on my part, awaiting merge :) |
Proposed fix for #4731
This is my first attempt at hacking something I want into ansible-lint, be gentle ;)
I was a bit surprised why all rule tests get a a full ruleset provided via
default_rules_collection
param as this makes the rules prone to breakage caused by other rules' auto-formating. I changed this and also made some assertions test ifdecprecated-local-action
actually matched, not the number of expected matches which may change in the future.