-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add a functional test for the spelling checker #6137
Conversation
@DanielNoord could you have a look, please ? I think it shows a regression from the argparse migration. |
Are you sure? This is an But I'll have a look! |
It's entirely possible that it's a pre-existing issue 😄 |
@Pierre-Sassoulas Uhm, what is the bug here? |
Hmm, thank you I jumped to conclusion sorry. Well I don't know how to enable this checker then. I'll investigate. |
Have you tried specifying a dictionary? diff --git a/pylintrc b/pylintrc
index c4816236..b9aa2292 100644
--- a/pylintrc
+++ b/pylintrc
@@ -423,7 +423,7 @@ missing-member-max-choices=1
# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
-spelling-dict=
+spelling-dict=en-US
# List of comma separated words that should not be checked.
spelling-ignore-words= |
c89e6ec
to
7e5cc87
Compare
Thank you @jacobtylerwalls it worked ! |
Pull Request Test Coverage Report for Build 2897447512
💛 - Coveralls |
@@ -0,0 +1,20 @@ | |||
wrong-spelling-in-comment:1:0:None:None::"Wrong spelling of a word 'docstring' in a comment: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we understand why we get None:None
here on 3.10?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's the same on 3.7, 3.8, 3.9.. Probably because we're passing the line as an int instead of a node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to fix this in a follow-up PR? Or in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to do two:
- Pass node instead of line number as int
- Add pylint's msgids and symbols to the dictionary automatically
Probably better after we merge this one and #5929 though, we're very bsy right now 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! Could you make an issue about passing node
instead of line
in this checker though? So we don't forget about it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
897bbdf
to
65dd830
Compare
We're impacted by #5092 on pypy and windows, but pyenchant should have been installed. |
@Pierre-Sassoulas What is the state of this PR? Note that there is a |
The idea is to have an example of functional tests for the spelling checker so it's easier to add functional tests for contributors. I'm going to do a refactor to initialize variable in the constructor of the spelling checker and then rebase this one on it. |
Just thought about this some more: let's not do this. We can't really control which dictionary people will install locally. That's (imo) a bad design in |
Could we use our own fake dictionary for functional tests ? Beside there's the same issue in the unittest, right ? |
Yeah we currently skip those when we don't find the The only thing we could try is whether it works to set |
Let's move this to 2.15. |
65dd830
to
4c287ba
Compare
@Pierre-Sassoulas It's a bit much for one test... But this works 😅 |
Okay, I'm retracting that. Let's not do this. Let's just use the exisiting unittests for this: we control the dictionary there and it is also much easier to skip if the dictionary is missing compared to the 20+ lines needed for this to work in the functional tests. |
I have a plan to make this work, but I'm working on low hanging fruits right now 😄 |
I'm interested to see what you can come up with 😄 |
4c287ba
to
cafdc37
Compare
I should have talked about it because now I completely forgot what the plan was |
When rebasing I realized that the dict is changing depending on the operating system (even ubuntu 18.4 vs 20.4), so the suggestion changes. I guess the only solution would be to add our own dict, but let's use the unit test where it's easy to define our own dict instead (as you said). |
Following a failed attempt to add functional tests for spelling checker in pylint-dev#6137
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit cafdc37 |
Following a failed attempt to add functional tests for spelling checker in pylint-dev#6137
Following a failed attempt to add functional tests for spelling checker in pylint-dev#6137
Following a failed attempt to add functional tests for spelling checker in pylint-dev#6137
Following a failed attempt to add functional tests for spelling checker in #6137
Type of Changes
Description
Add a spelling functional tests:
Currently this fail with:
In order to be able to add a mypy example in #5929