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

Replace --skip-transform option with --fix #17

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

TamiTakamiya
Copy link
Contributor

For AAP-16412.

This will replace the --skip-transform option with the --fix option. While the --skip-transform option was for turning on/off the transform feature of ansible-lint, the new --fix option provides more flexibility (including turning on/off) by just passing the specified parameters to ansible-lint.

"with the --fix option and files are transformed according to the rules specified.",
"--fix",
dest="write_list", # This is how this option is stored in ansible_lint.
# default="all", <-- Commented out because this does not work as expected.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expected "all" will be set to args.write_list by default when default="all" is specified, but it does not set anything unless --fix option is explicitly set.

@@ -396,8 +399,10 @@ def parse_sarif_json(exclude_paths: list[str], sarif_file: str) -> None:

def update_argv(argv: list[str], args: argparse.Namespace) -> None:
"""Update arguments to ansible-lint based on arguments given to ansible-content-parser."""
if not args.skip_transform:
if getattr(args, "write_list", None) is None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how I set the default value (=all) to write_list.

@TamiTakamiya TamiTakamiya merged commit 51af65a into main Sep 27, 2023
1 check passed
@TamiTakamiya TamiTakamiya deleted the ttakamiy/AAP-16412/support-fix-option branch September 27, 2023 11:48
@TamiTakamiya TamiTakamiya restored the ttakamiy/AAP-16412/support-fix-option branch September 27, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants