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

Typos reports typos in _typos.toml #711

Closed
emilk opened this issue Apr 13, 2023 · 5 comments · Fixed by #762
Closed

Typos reports typos in _typos.toml #711

emilk opened this issue Apr 13, 2023 · 5 comments · Fixed by #762
Labels
bug Not as expected

Comments

@emilk
Copy link

emilk commented Apr 13, 2023

Adding your own extend-words is quite problematic:

❯ cat _typos.toml 
[default.extend-words]
grey = "gray"

❯ typos
error: `grey` should be `gray`
  --> ./_typos.toml:2:1
  |
2 | grey = "gray"
  | ^^^^

I would suggest typos ignore its own configuration file when checking for typos

@MAHDTech
Copy link

MAHDTech commented May 10, 2023

You can ignore the config files if you create a .ignore file in the root of your repo, you can add this.

# Ignore any typos config files
typos.toml
_typos.toml
.typos.toml

@emilk
Copy link
Author

emilk commented May 12, 2023

Yeah, I can also add it to _typos.toml itself:

[default.extend-words]
grey = "gray"

[files]
extend-exclude = ["_typos.toml"]

it just feels a bit silly that the default behavior is that typos trips on its own config file

@epage
Copy link
Collaborator

epage commented May 18, 2023

There are a couple of ways for us to fix this

  • Automatically put it in extend-exclude
    • This would allow someone to explicitly do spell checking of the file if they want (typos _typos.toml)
  • Add a new filetype and exclude chekcing the file by default
  • Hard code this directly in the source

Any thoughts on what approach to take?

@epage epage added the bug Not as expected label May 18, 2023
@emilk
Copy link
Author

emilk commented Jun 2, 2023

For me it makes sense to hard-code typos to ignore its own config files since the main purpose of the config files is to contain typos and their corrections

@sshishov
Copy link

Agree, why people want to check for typos the typos configuration file which contains all the typos?

epage added a commit to epage/typos that referenced this issue Jun 22, 2023
This doesn't use `extend-exclude` which means that `typos typos.toml`
will stil be skipped

This doesn't just skip the currently loaded config but any file name
that looks like a config, which might be a big aggressive but allows us
to do layered config in the future....  We've been saying that for a
while.

Fixes crate-ci#711
phip1611 pushed a commit to phip1611/typos that referenced this issue Dec 5, 2023
This doesn't use `extend-exclude` which means that `typos typos.toml`
will stil be skipped

This doesn't just skip the currently loaded config but any file name
that looks like a config, which might be a big aggressive but allows us
to do layered config in the future....  We've been saying that for a
while.

Fixes crate-ci#711
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants