Skip to content

Conversation

nikolaik
Copy link
Contributor

@nikolaik nikolaik commented Feb 3, 2025

Since lien is a frequently used legal term and also happens to be used when working with the Terraform Google
Terraform resource google_resource_manager_lien, it feels wrong to treat it as a typo.

Humbly suggesting to revert that change

This reverts commit 536ccb5.

Fixes #3630

Since `lien` is a word frequently used when working with the Google
Terraform Provider, it feels wrong to treat it as a typo.

Humbly suggesting to revert that change

This reverts commit 536ccb5.

Fixes codespell-project#3630
@nikolaik nikolaik requested a review from peternewman as a code owner February 3, 2025 09:31
@DimitriPapadopoulos DimitriPapadopoulos added the dictionary Changes to the dictionary label Feb 3, 2025
@DimitriPapadopoulos
Copy link
Collaborator

Note that this typo is in the rare dictionary. Perhaps the rare dictionary should not be selected by default.

Copy link
Collaborator

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move these to the code dictionary please, which seems like the right place to me given they upset programming related text, but are still potentially valid/useful outside of that domain.

@nikolaik nikolaik force-pushed the nikolaik/revert-lien branch from 107c1a1 to e41cf86 Compare February 5, 2025 15:41
@nikolaik nikolaik requested a review from peternewman February 5, 2025 15:41
@nikolaik nikolaik force-pushed the nikolaik/revert-lien branch from e41cf86 to 300afdc Compare February 5, 2025 15:43
@nikolaik nikolaik changed the title Revert "Add rare typo lien->line" Move lien to the code dictionary Feb 5, 2025
@nikolaik
Copy link
Contributor Author

nikolaik commented Feb 5, 2025

Can you move these to the code dictionary please, which seems like the right place to me given they upset programming related text, but are still potentially valid/useful outside of that domain.

Moved now

@DimitriPapadopoulos
Copy link
Collaborator

DimitriPapadopoulos commented Feb 5, 2025

@peternewman @nikolaik It seems to me that lien is not related to programming, but to a specific domain.

@nikolaik
Copy link
Contributor Author

nikolaik commented Feb 5, 2025

@peternewman @nikolaik It seems to me that lien is not related to programming, but to a specific domain.

I agree with you @DimitriPapadopoulos but no strong opinion, so open to go either way

@peternewman
Copy link
Collaborator

@peternewman @nikolaik It seems to me that lien is not related to programming, but to a specific domain.

When you say specific domain do you mean Google Terraform? Isn't that the same as say:

Which is only relevant to Assembler (AFAIK), to pick probably one of the more obscure ones?

@rjmoseley
Copy link

From my perspective it's not particularly related to programming, it's a legal term that just so happens to be used by Google Cloud Platform. Whilst it's that usage that has resulted in this debate, fundamentally it's just a word, and one I (native British English speaker) was familiar with long before I came across it's usage in GCP.

@nikolaik nikolaik force-pushed the nikolaik/revert-lien branch from 300afdc to 107c1a1 Compare February 12, 2025 10:40
@nikolaik
Copy link
Contributor Author

nikolaik commented Feb 12, 2025

From what I'm hearing in this discussion and #3630 is that adding a well defined word with current use as a misspelling would not make sense and do more harm than good. Originally added in #3460 as a misspelling with the justification "Found in Emacs."

I changed this PR back back to a plain revert, since that now seems like the best outcome, to me.

@nikolaik nikolaik changed the title Move lien to the code dictionary Revert adding lien to the rare dictionary Feb 12, 2025
@DimitriPapadopoulos DimitriPapadopoulos merged commit 99bb615 into codespell-project:main Feb 24, 2025
27 checks passed
@DimitriPapadopoulos
Copy link
Collaborator

In the long term, I would rather keep rare words in the rare dictionary, that's what it's for. Perhaps the rare dictionary shouldn't be selected by default.

I'll settle for removing this entry for now. Thank you @nikolaik.

Just noticed another possible alternative. From the README:

  1. Entry with one word, but with automatic fix disabled:

    clas->class, disabled because of name clash in c++
    

Note that there isn't a comma at the end of the line. The last argument is treated as the reason why a suggestion cannot be automatically applied.

Perhaps we should disable automatic fixes by adding a comment to all or part of the words in the rare dictionary. Example:

$ cat DICTIONARY.txt 
lien->line, actually a word in the OED and SCOWL (And Friends)
$ 
$ cat test.txt 
lien
$ 
$ codespell -w -D DICTIONARY.txt test.txt 
test.txt:1: lien ==> line  | actually a word in the oed and scowl (and friends)
$ 
$ codespell -D DICTIONARY.txt test.txt 
test.txt:1: lien ==> line  | actually a word in the oed and scowl (and friends)
$ 

@nikolaik
Copy link
Contributor Author

Thanks Dimitri!

@nikolaik
Copy link
Contributor Author

Autofixing cases which rely on a person using their discretion, where there is ambiguity (dictionary definition exists) sounds wrong to me.

@DimitriPapadopoulos
Copy link
Collaborator

Autofixing cases which rely on a person using their discretion, where there is ambiguity (dictionary definition exists) sounds wrong to me.

So would you agree to reintroducing lien in the rare dictionary, but with autofixing disabled?

@nikolaik
Copy link
Contributor Author

So would you agree to reintroducing lien in the rare dictionary, but with autofixing disabled?

I'm not in favour of reintroducing lien, for the reasons mentioned above. Though for existing fixes in the rare dictionary that have dictionary definitions, I would consider it, since that would be less of a breaking change for users.

I would like to add that one of the reasons this project appeals to me is that it provides an good out of the box experience, with defaults that fixes common mistakes, does not give false positives, and requires little intervention from users to give value. I use codespell via the pre-commit hook and one of the sources of friction are when a mistake has multiple possible fixes (ambiguous) which I don't mind. Though disabling autofix for fixes in the rare dictionary, that are part of the default experience, will add more friction, maybe too much.

@DimitriPapadopoulos
Copy link
Collaborator

So removing the rare dictionary from the default dictionaries would be the best option, wouldn't it?

@nikolaik
Copy link
Contributor Author

I can't say, it depends a lot on the contents of the rare dictionary, but it might

@DimitriPapadopoulos
Copy link
Collaborator

'rare' for rare (but valid) words that are likely to be errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dictionary Changes to the dictionary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider reverting lien->line

4 participants