Skip to content
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 --check inconsistent when run through a script command #1442

Open
linjer opened this issue Apr 29, 2024 · 2 comments
Open

hatch fmt --check inconsistent when run through a script command #1442

linjer opened this issue Apr 29, 2024 · 2 comments

Comments

@linjer
Copy link

linjer commented Apr 29, 2024

I have noticed that the results from running hatch fmt --check directly vs running the same command through a hatch run lint script yields different results.

The lint script is defined as follows:

[tool.hatch.envs.default.scripts]
lint = "hatch fmt --check {args:}"

The hatch run lint command appears to yield less errors, suggesting it is using a looser configuration when run through a script, vs directly via CLI.

@linjer
Copy link
Author

linjer commented Apr 29, 2024

Possibly also related, I've noticed this when getting versions of hatch:

$ hatch run hatch --version
Hatch, version 1.9.6
$ hatch --version

Hatch, version 1.9.7

@linjer
Copy link
Author

linjer commented Apr 30, 2024

Update: After running hatch run pip install hatch==1.9.7, both the hatch fmt --check and hatch run lint output became consistent again.

I guess the broader issue is ensuring consistency between the two instances. I would expect to be able to pin the version somewhere in my pyproject.toml or have hatch automatically sync hatch version inside environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant