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 auto-fixing implementation for jinja[spacing] rule #3691

Merged
merged 7 commits into from
Aug 31, 2023

Conversation

audgirka
Copy link
Contributor

@audgirka audgirka commented Aug 28, 2023

Related: #3634
Depends on #3693

When finding jina2 spacing errors a recommendation is produced, the key, value and path within the task is known. This information is added to the MatchError to be used later.

When transforming for a specific MatchError, use the metadata captured during the identification of the spacing issue to iterate the task and when a matching key and value are found, use the previously generated recommendation.

Because the MatchError was generated using a "normalized task" and the transform is operating on the original task, the path cannot be used to locate the key. This introduces the possibility or 2 identical key/value combinations being corrected out of order and is noted in the doc string of the respective function.

cidrblock

This comment was marked as outdated.

@github-actions github-actions bot added the bug label Aug 28, 2023
@cidrblock cidrblock changed the title Transform for jinja[spacing] rule Transform for jinja[spacing] rule Aug 28, 2023
@cidrblock cidrblock removed the bug label Aug 28, 2023
@github-actions github-actions bot added the bug label Aug 28, 2023
@audgirka audgirka requested a review from cidrblock August 29, 2023 11:37
Copy link
Contributor

@cidrblock cidrblock left a comment

Choose a reason for hiding this comment

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

I'll approve, but @ssbarnea will need to as well since I've got commits in here.

@ssbarnea ssbarnea changed the title Transform for jinja[spacing] rule Add auto-fixing implementation for jinja[spacing] rule Aug 31, 2023
@ssbarnea ssbarnea removed the bug label Aug 31, 2023
@ssbarnea ssbarnea enabled auto-merge (squash) August 31, 2023 17:22
@ssbarnea ssbarnea merged commit 2b6226e into main Aug 31, 2023
@ssbarnea ssbarnea deleted the fix/jinja-spacing branch August 31, 2023 17:35
nrdufour added a commit to nrdufour/home-ops that referenced this pull request Sep 7, 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.18.0` -> `==6.19.0` |

---

### Release Notes

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

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

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

#### Minor Changes

-   Add auto transform for no-log-password rule ([#&#8203;3708](ansible/ansible-lint#3708)) [@&#8203;ajinkyau](https://github.com/ajinkyau)
-   Add auto-fixing implementation for key-order\[task] rule ([#&#8203;3705](ansible/ansible-lint#3705)) [@&#8203;ajinkyau](https://github.com/ajinkyau)
-   Add auto-fixing implementation for `jinja[spacing]` rule ([#&#8203;3691](ansible/ansible-lint#3691)) [@&#8203;ajinkyau](https://github.com/ajinkyau)
-   Make schema validation messages more explicit ([#&#8203;3701](ansible/ansible-lint#3701)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
-   Transform for deprecated-local-action rule ([#&#8203;3689](ansible/ansible-lint#3689)) [@&#8203;ajinkyau](https://github.com/ajinkyau)

#### Bugfixes

-   Require ansible-compat>=4.1.10 ([#&#8203;3723](ansible/ansible-lint#3723)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
-   Skip altered path warning for `ansible-lint` installed by `pipx` ([#&#8203;3720](ansible/ansible-lint#3720)) [@&#8203;chrysle](https://github.com/chrysle)
-   Update transform for `key-order` rule ([#&#8203;3719](ansible/ansible-lint#3719)) [@&#8203;ajinkyau](https://github.com/ajinkyau)
-   Allow installation of pre-release collection version as dependencies ([#&#8203;3716](ansible/ansible-lint#3716)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
-   Avoid deprecated-bare-vars false positive with file paths ([#&#8203;3709](ansible/ansible-lint#3709)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
-   Limit sequence-of-sequence indents to a single space ([#&#8203;3671](ansible/ansible-lint#3671)) [@&#8203;Qalthos](https://github.com/Qalthos)
-   Avoid no-handlers false positives ([#&#8203;3702](ansible/ansible-lint#3702)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
-   Add missing word to risky-shell-pipe docs ([#&#8203;3704](ansible/ansible-lint#3704)) [@&#8203;roock](https://github.com/roock)
-   Avoid yamllint truthy violations with github workflows ([#&#8203;3698](ansible/ansible-lint#3698)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
-   Avoid false positive with var-name rule on roles ([#&#8203;3697](ansible/ansible-lint#3697)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
-   Include links to documentation for schema validation errors ([#&#8203;3684](ansible/ansible-lint#3684)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
-   Schema update ([#&#8203;3693](ansible/ansible-lint#3693)) [@&#8203;cidrblock](https://github.com/cidrblock)
-   Use yaml.load_all for multiple yaml document ([#&#8203;3679](ansible/ansible-lint#3679)) [@&#8203;shatakshiiii](https://github.com/shatakshiiii)
-   Ignore user configured value for any_unparsed_is_failed ([#&#8203;3680](ansible/ansible-lint#3680)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
-   Update rulebook schema ([#&#8203;3681](ansible/ansible-lint#3681)) [@&#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/76
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
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants