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

no-same-owner: refactor to use matchtask() #2233

Merged
merged 2 commits into from Jul 12, 2022

Conversation

nishipy
Copy link
Contributor

@nishipy nishipy commented Jul 11, 2022

A part of #2105.

This PR refactors the no_same_owner rule and resolves the following problem. Please refer to #2105 (comment).

  • currently uses matchplay() with custom match methods: handle_play(), handle_playlist(), handle_task().
  • like no-loop-var-prefix this also misses rescue and always.
  • the handle_*() and matchplay() methods should be condensed into a single matchtask() (handle_unarchive() and
    handle_synchronize() would probably stay as they are)

Signed-off-by: nishipy <goodisonev4@gmail.com>
@nishipy nishipy requested review from a team as code owners July 11, 2022 09:02
@ssbarnea ssbarnea changed the title Refactor no_same_owner rule to condense methods into matchtask() no-same-owner: refactor to use matchtask() Jul 11, 2022
@ssbarnea ssbarnea added the bug label Jul 11, 2022
Copy link
Member

@cognifloyd cognifloyd left a comment

Choose a reason for hiding this comment

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

That is a beautiful refactoring. The rule is much clearer now, and it reuses the ansible-lint primitives. Thank you!

@ssbarnea ssbarnea merged commit 8c1cc34 into ansible:main Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants