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 rule to check the number of tasks #3156

Merged
merged 5 commits into from
Jun 23, 2023
Merged

Conversation

Ruchip16
Copy link
Member

@Ruchip16 Ruchip16 commented Mar 9, 2023

Introduce a new experimental rule that checks that number of tasks per file is less than
100.

Related: #2173
Fixes: #2172

@Ruchip16 Ruchip16 requested a review from a team as a code owner March 9, 2023 06:47
@Ruchip16 Ruchip16 requested review from a team, ssbarnea, audgirka and priyamsahoo March 9, 2023 06:47
@ssbarnea ssbarnea changed the title count no of tasks rule Add rule to check the number of tasks for rule Mar 9, 2023
Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

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

@Ruchip16 Please be sure that you address all the linting problems, tox -e lint should pass before the effective review starts.

@Ruchip16
Copy link
Member Author

Ruchip16 commented Mar 9, 2023

@Ruchip16 Please be sure that you address all the linting problems, tox -e lint should pass before the effective review starts.

sure, i will keep in mind

Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

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

  • Add a complexity.md file with documentation about rule
  • Create a symlink from docs/rules/complexity.md -> the one in source code
  • Add tests inside complexity.py file like in other rules (pytest)
  • Update description field
  • Update version_added and make it "v6.15.0"
  • Update tags to include "experimental" and "idiom"

There should be two test files named:

  • examples/playbooks/rule-complexity-pass.yml
  • examples/playbooks/rule-complexity-fail.yml

@priyamsahoo priyamsahoo changed the title Add rule to check the number of tasks for rule Add rule to check the number of tasks Mar 20, 2023
@Ruchip16 Ruchip16 requested a review from ssbarnea March 24, 2023 13:27
@ssbarnea ssbarnea force-pushed the depth_block branch 2 times, most recently from 2449d0a to dfc6fbf Compare April 19, 2023 13:48
@ssbarnea ssbarnea requested review from cidrblock and ssbarnea April 19, 2023 13:49
@ssbarnea ssbarnea added the incomplete Additional work or information is required label Apr 19, 2023
@ssbarnea ssbarnea marked this pull request as draft April 19, 2023 17:47
@ssbarnea
Copy link
Member

I tried to get this in and uncovered a longer chain of issues, so I am moving it draft until I do the preparatory work to get it in.

@audgirka
Copy link
Contributor

@ssbarnea can I start working on this?

@ssbarnea
Copy link
Member

Yes, please.

@audgirka audgirka removed the incomplete Additional work or information is required label Jun 15, 2023
@audgirka audgirka marked this pull request as ready for review June 22, 2023 10:30
.vscode/settings.json Outdated Show resolved Hide resolved
@audgirka audgirka force-pushed the depth_block branch 2 times, most recently from 6f855da to db0dbc5 Compare June 23, 2023 01:40
@audgirka audgirka force-pushed the depth_block branch 5 times, most recently from 96f4bac to 583fb04 Compare June 23, 2023 01:49
@ssbarnea ssbarnea merged commit 52ce164 into ansible:main Jun 23, 2023
@Ruchip16 Ruchip16 deleted the depth_block branch June 28, 2023 10:55
nrdufour added a commit to nrdufour/home-ops that referenced this pull request Aug 22, 2023
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ansible-lint](https://github.com/ansible/ansible-lint) ([changelog](https://github.com/ansible/ansible-lint/releases)) | minor | `==6.17.2` -> `==6.18.0` |

---

### Release Notes

<details>
<summary>ansible/ansible-lint (ansible-lint)</summary>

### [`v6.18.0`](https://github.com/ansible/ansible-lint/releases/tag/v6.18.0)

[Compare Source](ansible/ansible-lint@v6.17.2...v6.18.0)

#### Minor Changes

-   Limit the maximum block depth ([#&#8203;3602](ansible/ansible-lint#3602)) [@&#8203;Ruchip16](https://github.com/Ruchip16)
-   Transform functionality for command_instead_of_shell  ([#&#8203;3675](ansible/ansible-lint#3675)) [@&#8203;ajinkyau](https://github.com/ajinkyau)
-   Add rule to check the number of tasks ([#&#8203;3156](ansible/ansible-lint#3156)) [@&#8203;Ruchip16](https://github.com/Ruchip16)

#### Bugfixes

-   Clarify loop-var-prefix rule and code snippet ([#&#8203;3642](ansible/ansible-lint#3642)) [@&#8203;schwarmco](https://github.com/schwarmco)
-   Update `version_added` for complexity rule ([#&#8203;3623](ansible/ansible-lint#3623)) [@&#8203;ajinkyau](https://github.com/ajinkyau)
-   Ensure that single space between tasks is preserved when using --write ([#&#8203;3641](ansible/ansible-lint#3641)) [@&#8203;shatakshiiii](https://github.com/shatakshiiii)
-   Update ansible-compat used for testing ([#&#8203;3664](ansible/ansible-lint#3664)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
-   Document `yaml[line-length]` rule ([#&#8203;3653](ansible/ansible-lint#3653)) [@&#8203;shatakshiiii](https://github.com/shatakshiiii)
-   Prevent use of spdx-tools 0.8.0 due to breaking changes ([#&#8203;3649](ansible/ansible-lint#3649)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
-   fixes dead marketplace link ([#&#8203;3631](ansible/ansible-lint#3631)) [@&#8203;wookietreiber](https://github.com/wookietreiber)
-   Improve profile information on summary line ([#&#8203;3637](ansible/ansible-lint#3637)) [@&#8203;ziegenberg](https://github.com/ziegenberg)
-   command-instead-of-module: allow `git rev-parse` ([#&#8203;3610](ansible/ansible-lint#3610)) [@&#8203;JohnVillalovos](https://github.com/JohnVillalovos)
-   Include filepaths starting from $HOME in lintables ([#&#8203;3621](ansible/ansible-lint#3621)) [@&#8203;shatakshiiii](https://github.com/shatakshiiii)
-   Update \_mockings.py to fix bug created in [#&#8203;3390](ansible/ansible-lint#3390) ([#&#8203;3614](ansible/ansible-lint#3614)) [@&#8203;karcaw](https://github.com/karcaw)
-   Allow to set gather_facts as templated boolean ([#&#8203;3606](ansible/ansible-lint#3606)) [@&#8203;noonedeadpunk](https://github.com/noonedeadpunk)
-   Add dependency version check for collection metadata ([#&#8203;3601](ansible/ansible-lint#3601)) [@&#8203;ajinkyau](https://github.com/ajinkyau)
-   Fix installation of dependencies when run as an action ([#&#8203;3592](ansible/ansible-lint#3592)) [@&#8203;ssbarnea](https://github.com/ssbarnea)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yMy4yIiwidXBkYXRlZEluVmVyIjoiMzYuMjMuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Reviewed-on: https://git.home/nrdufour/home-ops/pulls/49
Co-authored-by: Renovate <[email protected]>
Co-committed-by: Renovate <[email protected]>
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.

max-tasks: Limit the number of tasks in a task file
3 participants