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

Add optional rule that check for no-same-owner #1450

Merged
merged 1 commit into from Mar 10, 2021
Merged

Add optional rule that check for no-same-owner #1450

merged 1 commit into from Mar 10, 2021

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Mar 10, 2021

Add a new rule that identifies use of the same owner when transferring files between hosts as a violation.

This rule is disabled by default and user needs to manually activate it inside the config as it is needed only for very particular use-cases.

Adding this rule to the linter should make it much easier for others to reuse it if they seem fit and ease upgrades of the linter, as the custom rule no longer needs to be ported to newer version of the linter.

Reference: https://zuul-ci.org/docs/zuul-jobs/policy.html#preservation-of-owner-between-executor-and-remote

@ssbarnea ssbarnea requested a review from albinvass March 10, 2021 15:39
@ssbarnea ssbarnea marked this pull request as ready for review March 10, 2021 15:40
@ssbarnea ssbarnea added this to the 5.0.3 milestone Mar 10, 2021
Add a new rule that identifies use of the same owner when transferring
files between hosts as a violation.

This rule is disabled by default and user needs to manually activate
it inside the config as it is needed only for very particular
use-cases.

Reference: https://zuul-ci.org/docs/zuul-jobs/policy.html#preservation-of-owner-between-executor-and-remote
Copy link
Contributor

@greg-hellings greg-hellings left a comment

Choose a reason for hiding this comment

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

I like the addition of opt-in rules. Can we get it mentioned in the docs?

@ssbarnea
Copy link
Member Author

I like the addition of opt-in rules. Can we get it mentioned in the docs?

We already do, because the .ansible-lint file from the root of the repository is included inside the docs at config, section. Basically we documented it by only mentioning it there, is sneaky but practical, look at https://ansible-lint.readthedocs.io/en/latest/configuring.html

ziegenberg added a commit to ziegenberg/ansible-lint that referenced this pull request May 3, 2022
With PR ansible#1450 optional rules with the 'opt-in' tag were introduced
and according to the docs, listing rules and tags with `-v` should
also list the opt-in rules.

Fixes: ansible#2068

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
ziegenberg added a commit to ziegenberg/ansible-lint that referenced this pull request May 3, 2022
With PR ansible#1450 optional rules with the 'opt-in' tag were introduced
and according to the docs, listing rules and tags with `-v` should
also list the opt-in rules.

Fixes: ansible#2068

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
ziegenberg added a commit to ziegenberg/ansible-lint that referenced this pull request May 3, 2022
With PR ansible#1450 optional rules with the 'opt-in' tag were introduced
and according to the docs, listing rules and tags with `-v` should
also list the opt-in rules.

Fixes: ansible#2068

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
ziegenberg added a commit to ziegenberg/ansible-lint that referenced this pull request May 4, 2022
With PR ansible#1450 optional rules with the 'opt-in' tag were introduced
and according to the docs, listing rules and tags should also list
the opt-in rules.

Fixes: ansible#2068

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
ziegenberg added a commit to ziegenberg/ansible-lint that referenced this pull request May 4, 2022
With PR ansible#1450 optional rules with the 'opt-in' tag were introduced
and according to the docs, listing rules and tags should also list
the opt-in rules.

Fixes: ansible#2068

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
ssbarnea added a commit that referenced this pull request May 4, 2022
* Include opt-in rules when listing tags and rules

With PR #1450 optional rules with the 'opt-in' tag were introduced
and according to the docs, listing rules and tags should also list
the opt-in rules.

Fixes: #2068

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>

* gracefully handle invalid format options with listing rules

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>

* put arguments -L and -T into a mutually exclusive group

We either print a list of rules or a list of tags, but never
both at the same time. So it makes no sense to allow giving
both arguments at the same time.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>

* always provide a long form of cli arguments

Having short cli arguments for often used options is nice to have
when using the command in an interactive shell. For writing scripts
it would be better to have long forms of arguments as it increases
the readebility.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>

* Update tox.yml

Co-authored-by: Sorin Sbarnea <sorin.sbarnea@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants