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

FIX: Caps and pytest #482

Merged
merged 5 commits into from
May 7, 2018
Merged

FIX: Caps and pytest #482

merged 5 commits into from
May 7, 2018

Conversation

larsoner
Copy link
Member

@larsoner larsoner commented May 4, 2018

This PR:

  1. Adds a test that all entries are lower
  2. Adds a test that capitalized entries are checked
  3. Fixes dictionary.txt entries that used to be non-lower
  4. Transitions to using pytest instead of nose since nose is no longer maintained
  5. Updates tests to use plain assert in pytest style

@codecov-io
Copy link

codecov-io commented May 4, 2018

Codecov Report

Merging #482 into master will increase coverage by 0.95%.
The diff coverage is 98.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #482      +/-   ##
==========================================
+ Coverage   87.81%   88.77%   +0.95%     
==========================================
  Files           2        3       +1     
  Lines         665      704      +39     
  Branches       93      100       +7     
==========================================
+ Hits          584      625      +41     
+ Misses         62       60       -2     
  Partials       19       19
Impacted Files Coverage Δ
codespell_lib/_codespell.py 82.8% <66.66%> (+0.88%) ⬆️
codespell_lib/tests/test_basic.py 95.69% <99.11%> (+0.19%) ⬆️
codespell_lib/__init__.py 100% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90fcc8f...25b4482. Read the comment docs.

@larsoner
Copy link
Member Author

larsoner commented May 4, 2018

@luzpaz @EdwardBetts feel free to have a look if you have time

Copy link
Collaborator

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor issues with the dictionary data.

Can I suggest, rather than throwing away the existing metadata in the dictionary in terms of case (on the replacement side), can I suggest just lower casing it in the code for now. Then at some point in the future when someone improves it, it could do the correct case changes too (potentially even looking at the case of the incorrect spelling to decide whether to use as offered, or all upper on the output).

@@ -784,7 +784,7 @@ aparment->apartment
apear->appear
apeends->appends
apendix->appendix
apenines->apennines, Apennines,
apenines->apennines, apennines,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now the same suggested correction twice. Which again I guess the dictionary validation ought to catch.

@@ -809,7 +809,7 @@ appedn->append
appendent->appended
appendign->appending
appeneded->appended
appenines->apennines, Apennines,
appenines->apennines, apennines,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again

@larsoner
Copy link
Member Author

larsoner commented May 4, 2018

Agreed @peternewman, feel free to look to see if this is what you had in mind

Copy link
Collaborator

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more minor comments, but LGTM.

@@ -304,6 +304,10 @@ def build_dict(filename):
with codecs.open(filename, mode='r', buffering=1, encoding='utf-8') as f:
for line in f:
[key, data] = line.split('->')
# For now, convert both to lower. Someday we can maybe add support
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a TODO, or do you not do that in Codespell?

@@ -1531,8 +1530,7 @@ bootstapped->bootstrapped
bootstapping->bootstrapping
bootstaps->bootstraps
boradcast->broadcast
bordrelines->borderline
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest this should be:

bordreline->borderline
bordrelines->borderlines

Given:
https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance

Which I can't remember where I found, possibly here.

@larsoner
Copy link
Member Author

larsoner commented May 7, 2018

Thanks for the looks @peternewman, I'll merge after the CIs come back happy from this one

@larsoner larsoner merged commit 50bcf82 into codespell-project:master May 7, 2018
@larsoner larsoner deleted the caps branch May 7, 2018 17:27
Copy link
Collaborator

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants