-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add custom configs #16
Conversation
Thanks for your work on this. I have made an issue for Hatch about using a .config folder: pypa/hatch#867. The author responded "Top-level --config https://hatch.pypa.io/latest/cli/reference/" which sounds like you've tried. if In ruff documentation it says "As an alternative to pyproject.toml, Ruff will also respect a ruff.toml (or .ruff.toml) file, which implements an equivalent schema (though the [tool.ruff] hierarchy can be omitted)." (https://beta.ruff.rs/docs/configuration/#using-rufftoml) It says can be omitted. Did you find that the [tool.ruff] hierarchy must be omitted? If so, please can you create an issue on the ruff project to get this clarified. I think the
This is so that the Hatch stuff is consecutive in the |
Thanks for looking into all of that Mike.
Ah great to open a discussion. I think the confusion comes from the fact that In the local section it says: "By default, Hatch will look for a pyproject.toml file in the current working directory and any parent directories. The directory storing the first found file will be considered the project root.". This makes me think that the project configuration must be in the project root - I will mention this in the discussion.
Ah nice find, indeed I confirmed that with
Good idea, I've reorganized pyproject.toml a bit, let me know what you think. |
I like the reorganised pyproject.toml! What happens if you include the lines below in
Hopefully soon, Black won't be needed as its functionality will be in ruff. |
If I try to add the error: Failed to parse `/home/turnerm/sync/hdx-python-utilities/.config/ruff.toml`: TOML parse error at line 16, column 2
|
16 | [tool.black]
| ^^^^
unknown field `tool`, expected one of `allowed-confusables`, `builtins`, `cache-dir`, `dummy-variable-rgx`, `exclude`, `extend`, `extend-exclude`, `extend-ignore`, `extend-select`, `external`, `fix`, `fix-only`, `fixable`, `format`, `force-exclude`, `ignore`, `ignore-init-module-imports`, `line-length`, `required-version`, `respect-gitignore`, `select`, `show-source`, `show-fixes`, `src`, `namespace-packages`, `target-version`, `task-tags`, `typing-modules`, `unfixable`, `update-check`, `flake8-annotations`, `flake8-bandit`, `flake8-bugbear`, `flake8-builtins`, `flake8-comprehensions`, `flake8-errmsg`, `flake8-quotes`, `flake8-self`, `flake8-tidy-imports`, `flake8-type-checking`, `flake8-gettext`, `flake8-implicit-str-concat`, `flake8-import-conventions`, `flake8-pytest-style`, `flake8-unused-arguments`, `isort`, `mccabe`, `pep8-naming`, `pycodestyle`, `pydocstyle`, `pylint`, `pyupgrade`, `per-file-ignores` but |
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.
Thanks for checking. These changes all look fine to me.
More custom configs. A couple of issues to note:
black
andruff
configurations, because the formats of the files need to be different unfortunatelyhatch.toml
. There is a--config
option forhatch
but it's more for the general configuration fileconfig.toml
. I can keep searching / experimenting, as this would really pare downpyrpoject.toml