Skip to content

Conversation

@Jkhall81
Copy link
Contributor

@Jkhall81 Jkhall81 commented Jan 7, 2026

Summary

This PR fixes a bug where files were misidentified as tasks if the project was located inside a parent directory named tasks.

By anchoring the file discovery logic to the project root, the linter now performs glob matching against paths relative to the project directory. This prevents parent folder names from leaking into the kind identification process.

Changes

  • Modified kind_from_path to relativize file paths against the project root before matching against DEFAULT_KINDS.
  • Added a fallback to absolute paths for standalone files outside of a recognized project.
  • Added regression tests in test_file_utils.py covering nested parent directories and standard task discovery.

Fixes #4763

@Jkhall81 Jkhall81 force-pushed the fix/issue-4763-tasks-dir-discovery branch from cc3897c to 4160c71 Compare January 7, 2026 13:03
@github-actions github-actions bot added fix and removed fix labels Jan 7, 2026
@ssbarnea ssbarnea merged commit c17c39b into ansible:main Jan 7, 2026
19 of 20 checks passed
@github-project-automation github-project-automation bot moved this from Review to Done in 🧰 devtools project board Jan 7, 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.

Parent tasks directory anywhere above project_dir prevents kind discovery

2 participants