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

Reduce the number of ignored words for Codespell #654

Merged
merged 18 commits into from
Dec 13, 2022

Conversation

PProfizi
Copy link
Contributor

Resolves #653

@PProfizi PProfizi added the CI/CD Related to CI/CD label Nov 29, 2022
@PProfizi PProfizi requested a review from PipKat November 29, 2022 13:47
@PProfizi PProfizi self-assigned this Nov 29, 2022
@codecov
Copy link

codecov bot commented Nov 29, 2022

Codecov Report

Merging #654 (7932643) into master (4dd8b6a) will decrease coverage by 1.48%.
The diff coverage is 33.33%.

@@            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     

@PProfizi
Copy link
Contributor Author

I'll have to bypass requirements as Codecov is failing due to coverage.

@@ -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}")
Copy link
Member

@PipKat PipKat Dec 13, 2022

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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!

@PProfizi
Copy link
Contributor Author

PProfizi commented Dec 13, 2022

Just noticed Codespell is still raising unexpected errors:

  • Raising for "Ans" although it is in the list of ignored words
  • ./docs/source/user_guide/getting_started_with_dpf_server.rst:129: availale ==> available
  • ./docs/source/user_guide/getting_started_with_dpf_server.rst:130: availale ==> available
  • ./examples/00-basic/04-basic-load-file.py:125: accross ==> across
  • ./tests/test_lsdyna.py:47: TE ==> THE, BE, WE, TO
    ./tests/test_lsdyna.py:48: TE ==> THE, BE, WE, TO
    ./tests/test_lsdyna.py:49: TE ==> THE, BE, WE, TO
    ./tests/test_lsdyna.py:452: SIE ==> SIZE, SIGH, SIDE
    ./tests/test_lsdyna.py:453: SIE ==> SIZE, SIGH, SIDE
    ./tests/test_lsdyna.py:454: SIE ==> SIZE, SIGH, SIDE
    ./tests/test_lsdyna.py:502: TE ==> THE, BE, WE, TO
    ./tests/test_lsdyna.py:503: TE ==> THE, BE, WE, TO
    ./tests/test_lsdyna.py:504: TE ==> THE, BE, WE, TO
    so we might want to add TE and SIE as ignored --> edit: We should actually change the variable names to adhere to the PEP guidelines anyway.
  • ./ansys/dpf/core/operators/utility/merge_fields.py:25: containter ==> container should be fixed on the Server side

@PProfizi PProfizi merged commit b6b0e15 into master Dec 13, 2022
@PProfizi PProfizi deleted the fix/reduce_ignored_words branch December 13, 2022 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Related to CI/CD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce ignored words to a minimum for CodeSpell.
2 participants