Skip to content

Conversation

@Jkhall81
Copy link
Contributor

@Jkhall81 Jkhall81 commented Jan 6, 2026

Summary

This PR ensures that exclude_paths are correctly honored for unparseable or encrypted files (e.g., SOPS).

Previously, files that failed to load as valid YAML would trigger a load-failure even if they were explicitly excluded in the configuration. This occurred because explicit targets would bypass exclusion checks during the initialization phase.

Changes

  • Updated Runner._run() to perform a direct exclusion check when a YAML load exception is encountered.
  • Silences load-failure errors for any file matching the exclusion patterns, allowing the linter to skip them gracefully instead of crashing.
  • Maintains existing behavior where valid YAML files passed via CLI bypass exclusions.

Fixes #4745

@github-actions github-actions bot removed the fix label Jan 6, 2026
@github-actions github-actions bot added the fix label Jan 6, 2026
@ssbarnea ssbarnea enabled auto-merge (squash) January 6, 2026 10:37
@Jkhall81
Copy link
Contributor Author

Jkhall81 commented Jan 6, 2026

@ssbarnea I was going to mention the pathspec thing, but I checked the actions tab and it looks like you are already on it. Nice.

Fixes exclusion logic to correctly skip files that fail YAML loading. This prevents crashes on SOPS or invalid YAML when they are explicitly excluded. Fixes ansible#4745
auto-merge was automatically disabled January 6, 2026 12:25

Head branch was pushed to by a user without write access

@Jkhall81 Jkhall81 force-pushed the fix/issue-4745-exclude-yaml branch from e9a905a to 2023d0b Compare January 6, 2026 12:25
@github-actions github-actions bot added fix and removed fix labels Jan 6, 2026
@ssbarnea ssbarnea enabled auto-merge (squash) January 6, 2026 12:44
@ssbarnea ssbarnea merged commit d9d06c7 into ansible:main Jan 6, 2026
22 checks passed
@github-project-automation github-project-automation bot moved this from Review to Done in 🧰 devtools project board Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

exclude_paths doesn't apply to yaml files

2 participants