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

Case sensitive (case only) corrections #899

Open
scop opened this issue Jan 3, 2024 · 3 comments
Open

Case sensitive (case only) corrections #899

scop opened this issue Jan 3, 2024 · 3 comments

Comments

@scop
Copy link
Contributor

scop commented Jan 3, 2024

It seems on surface (admittedly not much homework done on my part) that typos does not support case only corrections. If that's the case, here's an RFE to support that :)

Some examples off the top of my head with which this would be useful:

  • ZigBee -> Zigbee
  • SystemD -> systemd
  • Day of week, month, etc names spelled in lowercase that should start with a capital letter (dunno if this would be more problematic than the above examples that are easy to recognize)
@epage
Copy link
Collaborator

epage commented Jan 3, 2024

Day of week, month, etc names spelled in lowercase that should start with a capital letter (dunno if this would be more problematic than the above examples that are easy to recognize)

The focus of typos is on source code, so we view days of week as either snake_case or CamelCase. We don't have the information (and getting the information is out of scope) for us to know when one case is preferred over another.

ZigBee -> Zigbee
SystemD -> systemd

If this is for case outside of variables, then see above.

If this is for how these should be cased in variables, this is the inverse of #795 where we need to take two words within an identifier and merge them into one word. This is a lot more doable than #795 as we already know what case is involved. We'd just have to deal with scanning identifiers for these words and figuring out precedence rules (e.g. but what "system" is the end of one word join and the start of another word join).

@scop
Copy link
Contributor Author

scop commented Jan 5, 2024

Hmm, I've always thought that the focus/scope of source code would include comments, docstrings, error message strings etc. Granted, I guess that'd mean a general purpose checker with some specific source code capabilities on variable and function names etc.

Anyway, FWIW, to me, variable and function names and such are a much less interesting area than things written specifically/only for humans to read, such as the ones mentioned above. Maybe typos is not the best possible match for this use case.

@epage
Copy link
Collaborator

epage commented Jan 6, 2024

My original motivating case was dealing with a typo in an API for a decade.

However, that doesn't mean this is exclusively for those cases. I have this run on code based with documentation or only documentation-only documents (RFCs). To meet our needs for generality and performance, its difficult to handle comments / documentation and knowing when the words in comments/documentation are regular language vs references to identifiers in the code.

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

No branches or pull requests

2 participants