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

Support for pyproject.toml #361

Closed
bdespond opened this issue Oct 22, 2021 · 4 comments · Fixed by #790
Closed

Support for pyproject.toml #361

bdespond opened this issue Oct 22, 2021 · 4 comments · Fixed by #790
Labels
enhancement Improve the expected

Comments

@bdespond
Copy link

Is it possible to use the pyproject.toml directly instead of creating a specific typos.toml file?

@epage epage added the enhancement Improve the expected label Oct 22, 2021
@epage
Copy link
Collaborator

epage commented Oct 22, 2021

At the moment, we don't support any project/language-specific config files, but it is definitely something that can be added!

For whoever gets to implementing this first, it'll involve an update to Config::from_dir. We'll need file-type-specific wrappers similar to what is done in cargo-release.

neiljp added a commit to neiljp/zulip-terminal that referenced this issue Mar 13, 2023
`typos` supports a toml file, but not pyproject.toml yet (see
crate-ci/typos#361). To avoid yet-another-config-file, this adds a list of
files to exclude in run-spellcheck, passed to typos on the command-line.

`codespell` excludes are already configured in pyproject.toml.

Since file excludes and reasons are added to run-spellcheck, explicitly
exclude it from being checked for both tools.
neiljp added a commit to neiljp/zulip-terminal that referenced this issue Mar 13, 2023
`typos` supports a toml file, but not pyproject.toml yet (see
crate-ci/typos#361). To avoid yet-another-config-file, this adds a list of
files to exclude in run-spellcheck, passed to typos on the command-line.

`codespell` excludes are already configured in pyproject.toml.

Since file excludes and reasons are added to run-spellcheck, explicitly
exclude it from being checked for both tools.
neiljp added a commit to zulip/zulip-terminal that referenced this issue Mar 16, 2023
`typos` supports a toml file, but not pyproject.toml yet (see
crate-ci/typos#361). To avoid yet-another-config-file, this adds a list of
files to exclude in run-spellcheck, passed to typos on the command-line.

`codespell` excludes are already configured in pyproject.toml.

Since file excludes and reasons are added to run-spellcheck, explicitly
exclude it from being checked for both tools.
dosisod added a commit to dosisod/typos that referenced this issue Aug 5, 2023
This PR adds support for parsing `pyproject.toml` config files. The convention
for these files is to put any tooling related configuration into the
`tool.NAME` section, so in this case, `tool.typos`. I have verified that the
changes are pulled correctly, even if the `tool.typos` section is not present.

Closes crate-ci#361.
@epage
Copy link
Collaborator

epage commented Aug 7, 2023

@dosisod something I overlooked in discussing this before was how this can affect looking for a config.

If someone has a typos.toml in the root of their repo and a pyproject.toml in a subdirectly without a tool.typos table, then they won't get their normal config.

We could also talk about whether we need to layer between config files with this change but I think we could save that discussion for another day

@epage epage closed this as completed in #790 Sep 6, 2023
epage pushed a commit that referenced this issue Sep 6, 2023
This PR adds support for parsing `pyproject.toml` config files. The convention
for these files is to put any tooling related configuration into the
`tool.NAME` section, so in this case, `tool.typos`. I have verified that the
changes are pulled correctly, even if the `tool.typos` section is not present.

Closes #361
@jgillard
Copy link

jgillard commented Sep 8, 2023

I've seen this has been released, but it's not documented that pyproject.toml is now an option for configuring this tool. Was that an oversight or intentional? i.e. is it fully supported to now move config from the separate typos toml file into pyproject.toml?

@dosisod
Copy link
Contributor

dosisod commented Sep 8, 2023

Thanks @jgillard , I forgot to document this. This feature should be good to go, you just need to relocate your settings to [tool.typos.xyz] instead of [xyz].

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

Successfully merging a pull request may close this issue.

4 participants