Skip to content

Conversation

dbrennand
Copy link
Contributor

@dbrennand dbrennand commented Sep 8, 2025

Passes the custom yamllint configuration to run_yamllint.

DEBUG    Loading custom /Users/dab/repos/forks/ansible-lint/test/fixtures/yamllint.yml config file, this extends our internal yamllint config.
DEBUG    Effective yamllint rules used: {'anchors': {'level': 'error', 'forbid-undeclared-aliases': True, 'forbid-duplicated-anchors': False, 'forbid-unused-anchors': False}, 'braces': {'level': 'error', 'forbid': False, 'min-spaces-inside': 0, 'max-spaces-inside': 1, 'min-spaces-inside-empty': -1, 'max-spaces-inside-empty': -1}, 'brackets': {'level': 'error', 'forbid': False, 'min-spaces-inside': 0, 'max-spaces-inside': 0, 'min-spaces-inside-empty': -1, 'max-spaces-inside-empty': -1}, 'colons': {'level': 'error', 'max-spaces-before': 0, 'max-spaces-after': 1}, 'commas': {'level': 'error', 'max-spaces-before': 0, 'min-spaces-after': 1, 'max-spaces-after': 1}, 'comments': {'level': 'warning', 'require-starting-space': True, 'ignore-shebangs': True, 'min-spaces-from-content': 1}, 'comments-indentation': False, 'document-end': False, 'document-start': False, 'empty-lines': {'level': 'error', 'max': 2, 'max-start': 0, 'max-end': 0}, 'empty-values': False, 'float-values': False, 'hyphens': {'level': 'error', 'max-spaces-after': 1}, 'indentation': {'level': 'error', 'spaces': 'consistent', 'indent-sequences': True, 'check-multi-line-strings': False}, 'key-duplicates': {'level': 'error', 'forbid-duplicated-merge-keys': False}, 'key-ordering': False, 'line-length': {'level': 'error', 'max': 111, 'allow-non-breakable-words': True, 'allow-non-breakable-inline-mappings': False}, 'new-line-at-end-of-file': {'level': 'error'}, 'new-lines': {'level': 'error', 'type': 'unix'}, 'octal-values': {'forbid-implicit-octal': True, 'forbid-explicit-octal': True, 'level': 'error'}, 'quoted-strings': False, 'trailing-spaces': {'level': 'error'}, 'truthy': {'level': 'warning', 'allowed-values': ['true', 'false'], 'check-keys': True}}

yaml[line-length]: Line too long (136 > 111 characters)
ansible_collections/local/testcollection/playbooks/playbook_4705.yml:8

Resolves #4705.

@dbrennand dbrennand requested a review from a team as a code owner September 8, 2025 21:47
@github-actions github-actions bot added the fix label Sep 8, 2025
@ssbarnea ssbarnea changed the title fix: #4705 fix: respect custom yamllint config Sep 8, 2025
@ssbarnea ssbarnea self-assigned this Sep 8, 2025
@ssbarnea ssbarnea marked this pull request as draft September 9, 2025 11:58
@dbrennand
Copy link
Contributor Author

dbrennand commented Oct 2, 2025

Hi @ssbarnea

I think the below error in the pre-commit hook for mypy is a false positive?

src/ansiblelint/rules/yaml_rule.py:69: error: Item "None" of "RulesCollection | None" has no attribute "app"  [union-attr]

I've traced this back to the RulesCollection. self.app is assigned and the comment suggests it would only be a None type during testing, and if so then get_app does the needful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Custom .yamllint config is still not applied correctly in 25.7.0
2 participants