Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature: allow 'misspellings' that are identifiers #160

Closed
dvdsk opened this issue Sep 11, 2024 · 8 comments · Fixed by #199
Closed

Feature: allow 'misspellings' that are identifiers #160

dvdsk opened this issue Sep 11, 2024 · 8 comments · Fixed by #199
Assignees
Labels
good first issue Good for newcomers

Comments

@dvdsk
Copy link

dvdsk commented Sep 11, 2024

Context:

I have a doc comment naming an identifier (in this case an parameter of the function). It has an underscore and harper highlights that as a spelling mistake.

Benefits:

  • no erroneous warnings
  • keeps the docs in sync with the underlying code. Change the name of the parameter of the function and you get a warning 🎉.

Details:
Should probably not allow all identifiers (maybe a config option), function names and parameter names might be a good default.

related: #29

@elijah-potter
Copy link
Collaborator

This is actually already implemented for identifiers that aren't either snake_case or chain-case. I'll look into getting this done sometime early next week. Sorry for the delay!

@elijah-potter elijah-potter added the good first issue Good for newcomers label Oct 1, 2024
@elijah-potter
Copy link
Collaborator

It looks like @grantlemons is looking into this. Grant: I'd suggest creating a new Harper Parser that wraps another parser. Have it collapse any token strings that match the pattern Word Underscore Word or Word Hyphen Word AND exist in a provided identifier dictionary. Let me know if you have any questions.

grantlemons added a commit that referenced this issue Oct 4, 2024
grantlemons added a commit that referenced this issue Oct 4, 2024
grantlemons added a commit that referenced this issue Oct 4, 2024
grantlemons added a commit that referenced this issue Oct 4, 2024
@elijah-potter
Copy link
Collaborator

We're actually going to reopen this issue until we have a release out that @dvdsk can confirm no longer has the problem.

@elijah-potter elijah-potter reopened this Oct 4, 2024
@dvdsk
Copy link
Author

dvdsk commented Oct 4, 2024

Thank you all very much for working on this! Ill go try it out immediately and let you know how it works after the weekend 👍

@dvdsk
Copy link
Author

dvdsk commented Oct 7, 2024

Worked in most cases 🎉. I ran into one issue thats still there but I think it has a different cause. So great work thanks you all very much! I will make a new report for the new issue.

@dvdsk dvdsk closed this as completed Oct 7, 2024
@dvdsk
Copy link
Author

dvdsk commented Oct 7, 2024

nvmd it all works perfectly! No other issues on my end 🥳

@dvdsk
Copy link
Author

dvdsk commented Oct 17, 2024

Apologies if this is spamy. But this feature just really helped my out. I refactored an API and forgot to update the docs. Harper gave me spell errors for words that where identifiers of the previous API.

Very very nice

@elijah-potter
Copy link
Collaborator

Not spamy at all. That actually makes us so happy. Glad Harper is doing something good.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
good first issue Good for newcomers
Projects
None yet
3 participants