Skip to content

fix: restore correct mapping indentation after anchors (#4935)#4936

Merged
shatakshiiii merged 1 commit intoansible:mainfrom
Jkhall81:fix/4935-fix-indent-bug
Jan 28, 2026
Merged

fix: restore correct mapping indentation after anchors (#4935)#4936
shatakshiiii merged 1 commit intoansible:mainfrom
Jkhall81:fix/4935-fix-indent-bug

Conversation

@Jkhall81
Copy link
Copy Markdown
Contributor

Summary

Fixed a bug where using a YAML anchor (like &anchor) on a list item caused the next lines to be indented too far to the right.

The code was accidentally counting the length of the anchor text as part of the indentation. This fix forces the linter to ignore the anchor's length and stick to the standard 2-space.

Fixes #4935

Copy link
Copy Markdown
Contributor

@shatakshiiii shatakshiiii left a comment

Choose a reason for hiding this comment

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

Thanks for this fix @Jkhall81!

@shatakshiiii shatakshiiii force-pushed the fix/4935-fix-indent-bug branch from 6afff92 to 1303a60 Compare January 28, 2026 07:59
@github-actions github-actions Bot added fix and removed fix labels Jan 28, 2026
@shatakshiiii shatakshiiii enabled auto-merge (squash) January 28, 2026 08:02
@shatakshiiii shatakshiiii merged commit ff636f7 into ansible:main Jan 28, 2026
22 checks passed
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.

ansible-lint --fix Indents mappings in list after anchor

2 participants