- Notifications
You must be signed in to change notification settings - Fork1.5k
ignore .ale-not-project-root directories during determine Python Proj…#4991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
ignore .ale-not-project-root directories during determine Python Proj…#4991
Uh oh!
There was an error while loading.Please reload this page.
Conversation
w0rp left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is a bit too hacky. I've prefer tweaking this a bit better to match project roots, possibly removing some of the old files we used to test for. I removedpytest.ini this morning, for example.
w0rp commentedJun 24, 2025
I tend to discourage configurations that might change behaviour in ALE specifically in a committed project file. |
mangin commentedJun 24, 2025
You're right — our current approach to determining the Python project root is admittedly a bit hacky, and it's true that we already rely on committed project files for this behavior. Right now, we walk up from "the file" until we hit a known config file, which works well for most projects. I understand the logic behind it — it's a simple heuristic that covers a lot of cases. That said, some projects can be structured in less conventional ways, and this method can be too optimistic. Personally, I’d like to have some mechanism to override or customize this behavior when needed. Do you have any thoughts on how we could allow users to explicitly set or override the Python project root? |
w0rp commentedJun 25, 2025
Let's change the behavior actually to prefer the value of the
Theoretically a breaking change, but a change for the better. For fun I'll set OpenAI Codex to the task and see how well it does... |
w0rp commentedJun 25, 2025
w0rp commentedAug 13, 2025
I'll close this one. See the draft of the other option I proposed here. |
…ect directory
Here’s a clearer and more polished version of your GitHub PR description, with improved grammar, clarity, and structure:
Problem
In our monorepo, we have a structure like this:
When using ALE (Asynchronous Lint Engine) for linting, it automatically determines the Python project root by locating the first directory that contains a Python config file (e.g.,
setup.cfg,pyproject.toml, etc.).However, in our setup, this behavior can be problematic. For example, ALE may incorrectly treat the top-level
mono_repo/project_*/setup.cfgas the root, instead of one of the nestedmono_repodirectory. This prevents us from applying linter rules defined at the project level.Proposed Solution
To address this, I propose introducing a marker file named
.ale-not-project-root. When ALE encounters this file, it will skip that directory as a potential Python project root and continue "searching deeper."Example Use Case
With this marker, ALE will skip
mono_repo/project_1andmono_repo/project_2and use thesetup.cfgfrom the root.Feedback
Does this approach sound reasonable? Happy to discuss alternatives or improvements.