-
Notifications
You must be signed in to change notification settings - Fork 109
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
DELET should be DELETE in "WHEN a user DELETEs /[...]" #745
Comments
Yes it is thinking you are using camelCase. If you run |
Thanks !
|
You can also ignore them by adding them to I'll leave this open for a bit to see how much general interest there is for this but I would lean towards |
I meet with this on a daily basis. |
I you have the same issue please add a thumbs up to let the maintainer know how many people are affected. [default]
extend-ignore-identifiers-re = [
"DELETEs" # https://github.com/crate-ci/typos/issues/745
] |
Reposting from duplicate #916:
The README.md:1:6: `COUL` -> `COULD`
README.md:2:6: `COUL` -> `COULD`
README.md:3:6: `COUL` -> `COULD`
README.md:4:6: `SHOUL` -> `SHOULD`, `SHAWL`, `SHOAL`
README.md:7:9: `WIL` -> `WILL`, `WELL`
README.md:8:6: `WIL` -> `WILL`, `WELL` Cases 5,6 and 9-12 seem to be handled correctly. It seems that a lowercase letter that follows an all uppercase word not ending in
EDIT: extend-ignore-re = ["[A-Z]+[^TFI][a-z]"] |
Typos word splitter is strict. If it sees a change in case, it will treat it as a word change. You can see this in action by running with
Whether it reports a typo because of that is dependent on what is in our list of typos. We don't have an approved list of words that have to be matched but a deny list of misspellings and how they can be corrected. |
That's handy insight, I think the issue with the output above is that a boundary between words is being treated as a word itself. |
As a human, its easy to look at these cases and recognize where the word split is. When encoding this, its much more difficult and either direction you go, you'll get things wrong. |
Fully agree, by no means am I suggesting a solution, just engaging in ascription. Describing the problem is helpful (for myself and possibly others) in understanding it. Two character words seem to be a particularly tricky thing since it touches on other issues (like hexadecminal representation). |
I’m relieved I’m not the first person to have this issue but I’m surprised nobody mentioned SQL so far. Many people write SQL keywords all uppercase and I use them as verbs, too. $ echo "A user CREATEs, ALTERs, SELECTs from, JOINs, INSERTs into, UPDATEs, DELETEs from or DROPs a table." | ./typos -
error: `INSER` should be `INSERT`
--> -:1:46
|
1 | A user CREATEs, ALTERs, SELECTs from, JOINs, INSERTs into, UPDATEs, DELETEs from or DROPs a table.
| ^^^^^
|
error: `UPDAT` should be `UPDATE`
--> -:1:60
|
1 | A user CREATEs, ALTERs, SELECTs from, JOINs, INSERTs into, UPDATEs, DELETEs from or DROPs a table.
| ^^^^^
|
error: `DELET` should be `DELETE`
--> -:1:69
|
1 | A user CREATEs, ALTERs, SELECTs from, JOINs, INSERTs into, UPDATEs, DELETEs from or DROPs a table.
| ^^^^^
|
$ ./typos --version
typos-cli 1.18.1 The tool also wanted to correct [default]
extend-ignore-identifiers-re = [
"\\bDELETEs\\b",
"\\bINSERTs\\b",
"\\bUPDATEs\\b",
] Update: added word boundary markers. Thanks @szepeviktor! |
Adding word boundaries may help.
|
* add typos ignore file crate-ci/typos#745 (comment) * move config file * delete file * file path relative to / * move to / * move file * moved?!
Ah I finally found this before trying to make a new issue. I have this as an example:
Is there a way to generically handle the case 'ALLCAPSs' and treat and check it with the valid-word-list? In other words; mark out (with a regex) what will be checked? I was looking at I could of course just start having a big manual list, but I know the pattern of these ALL_CAPS_IDENTIFIER + 's'. |
There is not a way to normalize custom casing and then check that. If this is something you do frequently and there isn't other punctuation, like backticks in markdown, that you want to use, it would likely be best to use |
Hi,
I have comments on tests that look like:
typos
seems to acceptPOSTs
,HEADs
,GETs
, but notDELETEs
(norOPTIONs
, but doesn't make much sense so it's OK):When I run
typos -w
, I end up with:DELETEEs
andOPTIONNs
.Maybe typo thinks I'm writing a new camelCase word instead of pluralizing ?
The text was updated successfully, but these errors were encountered: