-
Notifications
You must be signed in to change notification settings - Fork 25
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
Reduce the number of ignored words for Codespell #654
Conversation
Codecov Report
@@ Coverage Diff @@
## master #654 +/- ##
==========================================
- Coverage 88.19% 86.71% -1.49%
==========================================
Files 69 69
Lines 7760 7761 +1
==========================================
- Hits 6844 6730 -114
- Misses 916 1031 +115 |
# Conflicts: # ignore_words.txt
I'll have to bypass requirements as Codecov is failing due to coverage. |
ansys/dpf/core/collection.py
Outdated
@@ -329,7 +329,8 @@ def __getitem__(self, index): | |||
if not self_len: | |||
raise IndexError("This collection contains no items") | |||
if index >= self_len: | |||
raise IndexError(f"This collection contains only {self_len} entrie(s)") | |||
word = "entry" if self_len == 1 else "entries" | |||
raise IndexError(f"This collection contains only {self_len} {word}") |
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.
Error messages should be complete sentences, ending in a period. This can be addressed in future PRs over time. I'm not sure I fully comprehend what the error in line 333 would look like. If the word was ball, would the message be: This collection contains only ball."? Perhaps it would help to have the word item (or entry): This collection contains only one item, ball.
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.
@PipKat thank you, I will add the period.
As for the resulting sentence it would be:
- if only one "item" -> "This collection contains only 1 entry."
- if more -> "This collection contains only X entries."
This error message tells the user it is asking for more than exists.
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.
@PProfizi Got it! The Google developer's style guide that we are following does recommend writing out numbers less than 10, but if the second case can have a value of 10 or greater, than I think it is OK we use numbers. If you are interested, here is the Google guidelines for numbers: https://developers.google.com/style/numbers.
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.
@PipKat Thank you for the link!
Just noticed Codespell is still raising unexpected errors:
|
Resolves #653