Visitar URL original
fix: allow valid tabs in lineinfile nested in blocks (#4719) by Jkhall81 · Pull Request #4881 · ansible/ansible-lint · GitHub
Skip to content

fix: allow valid tabs in lineinfile nested in blocks (#4719) - #4881

Merged
ssbarnea merged 3 commits into
ansible:mainfrom
Jkhall81:fix/4719-no-tabs-block-nesting
Jan 6, 2026
Merged

ssbarnea merged 3 commits into
ansible:mainfrom
Jkhall81:fix/4719-no-tabs-block-nesting

Conversation

@Jkhall81

@Jkhall81 Jkhall81 commented Dec 31, 2025 •

Copy link
Copy Markdown
Contributor

Fixes a context-blindness issue where the no-tabs rule incorrectly flagged valid tab characters in lineinfile tasks when they were nested inside a block. By refactoring matchtask to validate keys gainst the allow_list globally within the task structure, the rule now correctly identifies whitelisted parameters (like regexp or line) regardless of nesting depth.

Fixes #4719

@Jkhall81
Jkhall81 requested a review from a team as a code owner December 31, 2025 17:15
@Jkhall81
Jkhall81 force-pushed the fix/4719-no-tabs-block-nesting branch from bbd6c5f to b415e9a Compare December 31, 2025 17:19
@Jkhall81
Jkhall81 force-pushed the fix/4719-no-tabs-block-nesting branch from b415e9a to 69a154b Compare December 31, 2025 17:21
@Jkhall81 Jkhall81 changed the title Fix/4719 no tabs block nesting Fix: allow valid tabs in lineinfile nested in blocks (#4719) Dec 31, 2025
@Jkhall81
Jkhall81 force-pushed the fix/4719-no-tabs-block-nesting branch from 69a154b to 736a7f9 Compare December 31, 2025 17:27
@Jkhall81 Jkhall81 changed the title Fix: allow valid tabs in lineinfile nested in blocks (#4719) fix: allow valid tabs in lineinfile nested in blocks (#4719) Dec 31, 2025
@Jkhall81
Jkhall81 force-pushed the fix/4719-no-tabs-block-nesting branch from 736a7f9 to c7b832c Compare December 31, 2025 17:36
@github-actions github-actions Bot added the fix label Dec 31, 2025
@Jkhall81
Jkhall81 force-pushed the fix/4719-no-tabs-block-nesting branch from c7b832c to 4c42db3 Compare December 31, 2025 17:56
@github-actions github-actions Bot added fix and removed fix labels Dec 31, 2025
@Jkhall81
Jkhall81 force-pushed the fix/4719-no-tabs-block-nesting branch from 4c42db3 to 2ad6390 Compare December 31, 2025 18:20
@github-actions github-actions Bot added fix and removed fix labels Dec 31, 2025
@Jkhall81
Jkhall81 force-pushed the fix/4719-no-tabs-block-nesting branch from 2ad6390 to 7d4e3e0 Compare December 31, 2025 18:31
@github-actions github-actions Bot added fix and removed fix labels Dec 31, 2025
@github-actions github-actions Bot added fix and removed fix labels Jan 5, 2026
@ssbarnea
ssbarnea merged commit f6f8393 into ansible:main Jan 6, 2026
21 checks passed
@github-project-automation github-project-automation Bot moved this from Review to Done in 🧰 devtools project board Jan 6, 2026
pat-s pushed a commit to devxygmbh/ansible-data-science-core that referenced this pull request Feb 17, 2026
… v26 (#83)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ansible-community/ansible-lint](https://github.com/ansible-community/ansible-lint) | repository | major | `v25.12.2` → `v26.1.1` |

Note: The `pre-commit` manager in Renovate is not supported by the `pre-commit` maintainers or community. Please do not report any problems there, instead [create a Discussion in the Renovate repository](https://github.com/renovatebot/renovate/discussions/new) if you have any questions.

---

### Release Notes

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

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

[Compare Source](ansible/ansible-lint@v26.1.0...v26.1.1)

#### Features

- feat: added exit code 8 for successfully fixed violations ([#&#8203;4674](ansible/ansible-lint#4674)) ([#&#8203;4899](ansible/ansible-lint#4899)) [@&#8203;Jkhall81](https://github.com/Jkhall81)

#### Fixes

- fix: resolve auto-fix failures and detection for short module names (… ([#&#8203;4897](ansible/ansible-lint#4897)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: ensure --no-offline overrides config file precedence ([#&#8203;4845](ansible/ansible-lint#4845)) ([#&#8203;4903](ansible/ansible-lint#4903)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: pre-commit cache missing cspell updates ([#&#8203;4909](ansible/ansible-lint#4909)) [@&#8203;alisonlhart](https://github.com/alisonlhart)
- Set cryptography ceiling to match downstream requirement. ([#&#8203;4904](ansible/ansible-lint#4904)) [@&#8203;cidrblock](https://github.com/cidrblock)
- fix: almalinux missing reference in platforms array ([#&#8203;4896](ansible/ansible-lint#4896)) [@&#8203;thelinuxracoon](https://github.com/thelinuxracoon)

#### Maintenance

- chore: Add renovate constraint for cryptography ([#&#8203;4911](ansible/ansible-lint#4911)) [@&#8203;alisonlhart](https://github.com/alisonlhart)

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

[Compare Source](ansible/ansible-lint@v26...v26.1.0)

#### Fixes

- fix: implement precise filtering for bracketed sub-tags ([#&#8203;4892](ansible/ansible-lint#4892)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: avoid unnecessary creation of .ansible folders ([#&#8203;4894](ansible/ansible-lint#4894)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- fix: refactor RulesCollection to always require app argument ([#&#8203;4891](ansible/ansible-lint#4891)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- fix: anchor kind discovery to project root ([#&#8203;4763](ansible/ansible-lint#4763)) ([#&#8203;4889](ansible/ansible-lint#4889)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: avoid creating cache directory when listing version ([#&#8203;4865](ansible/ansible-lint#4865)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- fix: ensure exclude\_paths are honored for unparseable files ([#&#8203;4886](ansible/ansible-lint#4886)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: avoid use of pathspec 1.0.0 until yamllint is updated ([#&#8203;4887](ansible/ansible-lint#4887)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- fix: allow valid tabs in lineinfile nested in blocks ([#&#8203;4719](ansible/ansible-lint#4719)) ([#&#8203;4881](ansible/ansible-lint#4881)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: update documentation to clarify requirement to run from project … ([#&#8203;4885](ansible/ansible-lint#4885)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: replace hardcoded /tmp path with secure temp directory (CWE… ([#&#8203;4878](ansible/ansible-lint#4878)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: handle missing keys in \_parse\_failed\_msg to prevent KeyError ([#&#8203;4879](ansible/ansible-lint#4879)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: add argument\_specs to meta schema ([#&#8203;4762](ansible/ansible-lint#4762)) ([#&#8203;4880](ansible/ansible-lint#4880)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: retire -p/--parseable option ([#&#8203;4884](ansible/ansible-lint#4884)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- fix: correct partial-become rule documentation comments ([#&#8203;4876](ansible/ansible-lint#4876)) [@&#8203;emmanuel-ferdman](https://github.com/emmanuel-ferdman)

#### Maintenance

- chore: add almalinux platform to meta schemas ([#&#8203;4893](ansible/ansible-lint#4893)) [@&#8203;thelinuxracoon](https://github.com/thelinuxracoon)
- chore: refactor testing code to reduce use of get\_app() ([#&#8203;4890](ansible/ansible-lint#4890)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- chore(deps): update all dependencies ([#&#8203;4877](ansible/ansible-lint#4877)) @&#8203;[renovate\[bot\]](https://github.com/apps/renovate)

### [`v26`](ansible/ansible-lint@v25.12.2...v26)

[Compare Source](ansible/ansible-lint@v25.12.2...v26)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **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:eyJjcmVhdGVkSW5WZXIiOiI0Mi42Ni45IiwidXBkYXRlZEluVmVyIjoiNDIuNzguMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: devxy-bot <no-reply@devxy.io>
Reviewed-on: https://codefloe.com/devxy/ansible-data-science-core/pulls/83
Co-authored-by: renovate-bot <renovate-bot@noreply.codefloe.com>
Co-committed-by: renovate-bot <renovate-bot@noreply.codefloe.com>
pat-s pushed a commit to devxygmbh/ansible-posit that referenced this pull request Feb 17, 2026
… v26 (#53)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ansible-community/ansible-lint](https://github.com/ansible-community/ansible-lint) | repository | major | `v25.12.2` → `v26.1.1` |

Note: The `pre-commit` manager in Renovate is not supported by the `pre-commit` maintainers or community. Please do not report any problems there, instead [create a Discussion in the Renovate repository](https://github.com/renovatebot/renovate/discussions/new) if you have any questions.

---

### Release Notes

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

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

[Compare Source](ansible/ansible-lint@v26.1.0...v26.1.1)

#### Features

- feat: added exit code 8 for successfully fixed violations ([#&#8203;4674](ansible/ansible-lint#4674)) ([#&#8203;4899](ansible/ansible-lint#4899)) [@&#8203;Jkhall81](https://github.com/Jkhall81)

#### Fixes

- fix: resolve auto-fix failures and detection for short module names (… ([#&#8203;4897](ansible/ansible-lint#4897)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: ensure --no-offline overrides config file precedence ([#&#8203;4845](ansible/ansible-lint#4845)) ([#&#8203;4903](ansible/ansible-lint#4903)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: pre-commit cache missing cspell updates ([#&#8203;4909](ansible/ansible-lint#4909)) [@&#8203;alisonlhart](https://github.com/alisonlhart)
- Set cryptography ceiling to match downstream requirement. ([#&#8203;4904](ansible/ansible-lint#4904)) [@&#8203;cidrblock](https://github.com/cidrblock)
- fix: almalinux missing reference in platforms array ([#&#8203;4896](ansible/ansible-lint#4896)) [@&#8203;thelinuxracoon](https://github.com/thelinuxracoon)

#### Maintenance

- chore: Add renovate constraint for cryptography ([#&#8203;4911](ansible/ansible-lint#4911)) [@&#8203;alisonlhart](https://github.com/alisonlhart)

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

[Compare Source](ansible/ansible-lint@v26...v26.1.0)

#### Fixes

- fix: implement precise filtering for bracketed sub-tags ([#&#8203;4892](ansible/ansible-lint#4892)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: avoid unnecessary creation of .ansible folders ([#&#8203;4894](ansible/ansible-lint#4894)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- fix: refactor RulesCollection to always require app argument ([#&#8203;4891](ansible/ansible-lint#4891)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- fix: anchor kind discovery to project root ([#&#8203;4763](ansible/ansible-lint#4763)) ([#&#8203;4889](ansible/ansible-lint#4889)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: avoid creating cache directory when listing version ([#&#8203;4865](ansible/ansible-lint#4865)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- fix: ensure exclude\_paths are honored for unparseable files ([#&#8203;4886](ansible/ansible-lint#4886)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: avoid use of pathspec 1.0.0 until yamllint is updated ([#&#8203;4887](ansible/ansible-lint#4887)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- fix: allow valid tabs in lineinfile nested in blocks ([#&#8203;4719](ansible/ansible-lint#4719)) ([#&#8203;4881](ansible/ansible-lint#4881)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: update documentation to clarify requirement to run from project … ([#&#8203;4885](ansible/ansible-lint#4885)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: replace hardcoded /tmp path with secure temp directory (CWE… ([#&#8203;4878](ansible/ansible-lint#4878)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: handle missing keys in \_parse\_failed\_msg to prevent KeyError ([#&#8203;4879](ansible/ansible-lint#4879)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: add argument\_specs to meta schema ([#&#8203;4762](ansible/ansible-lint#4762)) ([#&#8203;4880](ansible/ansible-lint#4880)) [@&#8203;Jkhall81](https://github.com/Jkhall81)
- fix: retire -p/--parseable option ([#&#8203;4884](ansible/ansible-lint#4884)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- fix: correct partial-become rule documentation comments ([#&#8203;4876](ansible/ansible-lint#4876)) [@&#8203;emmanuel-ferdman](https://github.com/emmanuel-ferdman)

#### Maintenance

- chore: add almalinux platform to meta schemas ([#&#8203;4893](ansible/ansible-lint#4893)) [@&#8203;thelinuxracoon](https://github.com/thelinuxracoon)
- chore: refactor testing code to reduce use of get\_app() ([#&#8203;4890](ansible/ansible-lint#4890)) [@&#8203;ssbarnea](https://github.com/ssbarnea)
- chore(deps): update all dependencies ([#&#8203;4877](ansible/ansible-lint#4877)) @&#8203;[renovate\[bot\]](https://github.com/apps/renovate)

### [`v26`](ansible/ansible-lint@v25.12.2...v26)

[Compare Source](ansible/ansible-lint@v25.12.2...v26)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **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:eyJjcmVhdGVkSW5WZXIiOiI0Mi42Ni45IiwidXBkYXRlZEluVmVyIjoiNDIuNzguMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: devxy-bot <no-reply@devxy.io>
Reviewed-on: https://codefloe.com/devxy/ansible-posit/pulls/53
Co-authored-by: renovate-bot <renovate-bot@noreply.codefloe.com>
Co-committed-by: renovate-bot <renovate-bot@noreply.codefloe.com>

This branch was previously deployed

1 inactive deployment
ack — 0d558d06 Deployed Jan 5, 2026 by alisonlhart via ack / ack #8315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

no-tabs Rule Does Not Recognize lineinfile Inside block

3 participants