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

Question: handling of technical acronyms #2719

Closed
jamesbraza opened this issue Jan 19, 2023 · 2 comments
Closed

Question: handling of technical acronyms #2719

jamesbraza opened this issue Jan 19, 2023 · 2 comments
Labels

Comments

@jamesbraza
Copy link
Contributor

Background

Firstly, I love codespell and have managed to get it adopted across the biotech company I work at. We use lots of chemicals and their abbreviations. For example, Acetonitrile is commonly called "ACN".

One design philosophy of readable code is having one's code mirror the way one speaks. For example, a chemist might say "flush the chamber with ACN," so a readable code representation might be instrument.flush_chamber(Fluids.ACN).

I have observed codespell tends to flag acronyms like ACN. From #1578 (comment), the current solution is to pass an allow list of lowercase'd acronyms:

[codespell]
ignore-words-list = acn

Currently, I have a steadily growing allow-list of chemical acronyms, which is a perfectly viable solution.

Question

What is codespell's stance on technical acronyms? Is there an alternate way of handling a steadily increasing number of technical acronyms (referring to various chemicals)?

Thank you in advance!

@DimitriPapadopoulos
Copy link
Collaborator

DimitriPapadopoulos commented Jan 20, 2023

Any misspelled word could ba a valid acronym. I don't really see a solution here, except maintaining your own dictionary of acronyms specific to your domain. Note that acronyms to skip can be added to a file for easier maintenance of the list.

@jamesbraza
Copy link
Contributor Author

Hi @DimitriPapadopoulos thank you for responding!

Any misspelled word could ba a valid acronym.

Yeah this is a strong point 😆

I know that codespell lowercases everything to avoid the combinatorial explosion of spelling possibilities. Perhaps there is some way to selectively ignore CONSTANT_CASE variable declarations, but I can't think of a good heuristic right now.

Anyways, my question is answered, so I will close this out! Feel free to re-open if desired.

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

No branches or pull requests

2 participants