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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hatch fmt doesn't ignore environments in the project directory #1460
Comments
This is fixed by having VCS ignore files so I think this is expected. Do you think project creation should instantiate Git? |
I haven't created a project. Literally all I did was Hmm, it appears that |
I just did a quick experiment. In a new directory, (Actually, it appears that ruff might explicitly ignore |
When you say "created a new directory" what did you mean? I took that to imply you created a directory and then entered the directory and then ran the other two commands. While implicit namespace packages are completely valid, indeed that is the modern way to do them, that rule is still a useful default because accidentally shipping something that cannot be imported is bad. You have to explicitly configure them with this option. |
Exactly that. You mentioned "project creation", but I didn't create anything that I would consider to be a "project".
That's debatable (obviously, because I strongly disagree with you). If you want hatch to be "opinionated" in the stance it takes on things like this, then so be it, but if that's the case, I think you should be up front about that fact and make it clear that hatch's choices will not be to everyone's liking. And that if someone doesn't agree with hatch's choices, they should look for another tool. Basically like
Not if INP001 is off by default. Which it is in ruff. But this is a discussion more for #1461. |
Okay, for the first part I guess to ask is for Hatch configuration to influence the default exclusion patterns. I think I can do that, sure! As far as that particular rule, I will comment on the other issue. |
Sorry, I'm not sure I follow. I may be misunderstanding, but from what I can see:
The fact that ruff cannot recognise hatch's environment directory by default is inconvenient, but not really easy to fix unless we get a de facto (or official) standard for where to store multiple venvs ( |
Simplest way to demonstrate this:
hatch env create
hatch fmt
Result:
Apart from the formatter finding an error in code that hatch generated for me, it shouldn't even be checking virtual environments.
My config file (which was left over from earlier experiments with hatch, so it was only by chance that I realised this isn't the default behaviour) has
to put project virtual environments in the project directory.
The text was updated successfully, but these errors were encountered: