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

Spell checking #2508

Open
gnzlbg opened this issue Mar 5, 2018 · 6 comments
Open

Spell checking #2508

gnzlbg opened this issue Mar 5, 2018 · 6 comments
Labels
A-documentation Area: Adding or improving documentation E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-AST Type: Requires working with the AST

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Mar 5, 2018

It would be nice if clippy could be able to spell-check comments, identifiers, ...

Previous work here: https://github.com/huonw/spellck

@birkenfeld
Copy link
Contributor

Please make this opt-in. The "Add backticks here" lint is already annoying enough.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Mar 6, 2018

I think that once this lint works properly it should be opt-out, but in any case some lints being annoying to some people is something that should be solved by #1313

@oli-obk
Copy link
Contributor

oli-obk commented Mar 6, 2018

Spell checking is hard. Especially with identifiers. If I turn on a spell checker on my code I get squiggly lines everywhere for stuff like ident, expr, ... I'd be fine with a restriction lint though

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Mar 6, 2018

@oli-obk I think one should start with spell checking documentation comments. If a word is incorrectly typed in a comment, we can then check whether its an identifier in the code, and not emit a diagnostic. But spelling errors in documentation comments are annoying.

Spell checking identifiers should be done with great care, and probably will remain opt-in forever. Some people prefer idx over index and that should be alright, but imdex should probably raise a spell checker warning about meaning index instead. @huonw solved this by allowing the user to white-list words, but that's a lot of work.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 6, 2018

Well we can skip text in backticks. And since one should be placing identifiers in backticks, they aren't linted in doc comments.

@oli-obk oli-obk added E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-AST Type: Requires working with the AST A-documentation Area: Adding or improving documentation labels Mar 6, 2018
@clarfonthey
Copy link
Contributor

I think that spelling isn't a huge issue considering how variable typos are compile errors, rather than runtime errors. Sure, I'd have loved this for the times when I was developing in PHP and didn't notice the difference between $receive and $recieve, but in Rust, the compiler itself already fuzzes the missing references to provide suggestions.

For docs, it might be useful, but it should ignore items in backticks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Adding or improving documentation E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-AST Type: Requires working with the AST
Projects
None yet
Development

No branches or pull requests

4 participants