Skip to content

Commit

Permalink
FIX: Caps and pytest (#482)
Browse files Browse the repository at this point in the history
* FIX: Caps and pytest

* FIX: Check in code

* FIX: Check for unique names

* FIX: Minor fixes

* FIX: More checks
  • Loading branch information
larsoner authored May 7, 2018
1 parent 90fcc8f commit 50bcf82
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 123 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ ld
codespell.egg-info
*.pyc
.cache/
.pytest_cache/
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ before_install:
- source venv/bin/activate
- python --version # just to check
- pip install -U pip wheel # upgrade to latest pip find 3.5 wheels; wheel to avoid errors
- retry pip install nose flake8 coverage codecov chardet setuptools
- retry pip install pytest pytest-cov pytest-sugar flake8 coverage codecov chardet setuptools
- cd $SRC_DIR

install:
Expand All @@ -51,7 +51,7 @@ script:
# this file has an error
- "! codespell codespell_lib/tests/test_basic.py"
- flake8
- nosetests
- pytest codespell_lib

after_success:
- codecov
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
environment:
global:
PYTHON: "C:\\conda"
CONDA_DEPENDENCIES: "nose setuptools flake8 coverage chardet"
PIP_DEPENDENCIES: "codecov"
CONDA_DEPENDENCIES: "pytest pytest-cov setuptools flake8 coverage chardet"
PIP_DEPENDENCIES: "codecov pytest-sugar"
matrix:
- PYTHON_VERSION: "2.7"
PYTHON_ARCH: "32"
Expand All @@ -21,7 +21,7 @@ build: false # Not a C# project, build stuff at the test step instead.
test_script:
- "codespell --help"
- "flake8"
- "nosetests"
- "pytest codespell_lib"

on_success:
- "codecov"
6 changes: 5 additions & 1 deletion codespell_lib/_codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('->')
# TODO for now, convert both to lower. Someday we can maybe add
# support for fixing caps.
key = key.lower()
data = data.lower()
if key in ignore_words:
continue
data = data.strip()
Expand Down Expand Up @@ -588,7 +592,7 @@ def main(*args):

dictionaries = options.dictionary or [default_dictionary]
for dictionary in dictionaries:
if dictionary is "-":
if dictionary == "-":
dictionary = default_dictionary
if not os.path.exists(dictionary):
print('ERROR: cannot find dictionary file: %s' % dictionary,
Expand Down
56 changes: 22 additions & 34 deletions codespell_lib/data/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ achievment->achievement
achievments->achievements
achitecture->architecture
achitectures->architectures
achive->achieve
achive->achieve, archive,
achived->achieved, archived,
achivement->achievement
Expand Down Expand Up @@ -784,7 +783,7 @@ aparment->apartment
apear->appear
apeends->appends
apendix->appendix
apenines->apennines, Apennines,
apenines->Apennines
aplication->application
aplied->applied
apllicatin->application
Expand All @@ -809,7 +808,7 @@ appedn->append
appendent->appended
appendign->appending
appeneded->appended
appenines->apennines, Apennines,
appenines->Apennines
appens->appends
apperance->appearance
apperances->appearances
Expand Down Expand Up @@ -1533,7 +1532,7 @@ bootstapped->bootstrapped
bootstapping->bootstrapping
bootstaps->bootstraps
boradcast->broadcast
bordrelines->borderline
bordreline->borderline
bordrelines->borderlines
borke->broke
bothe->both
Expand Down Expand Up @@ -1903,8 +1902,7 @@ chanel->channel
changable->changeable
changuing->changing
chanined->chained
chaning->chaining
chaning->changing
chaning->chaining, changing,
channle->channel
channles->channels
channnel->channel
Expand Down Expand Up @@ -2114,7 +2112,7 @@ codepoitn->codepoint
codespel->codespell
coditions->conditions
coefficent->coefficient
coefficents->coefficients
coefficents->coefficients
coeficent->coefficient
coeficents->coefficients
cofigure->configure
Expand Down Expand Up @@ -2326,7 +2324,6 @@ competance->competence
competant->competent
competative->competitive
competion->competition, completion,
competion->completion
competions->completions
competitiion->competition
competive->competitive
Expand Down Expand Up @@ -2971,7 +2968,6 @@ covnert->convert
coyp->copy
coypright->copyright
cpation->caption
cpoy->copy
cpoy->coy, copy,
craete->create
crahses->crashes
Expand Down Expand Up @@ -3052,7 +3048,7 @@ cursro->cursor
customable->customizable
custome->custom, costume,
custumized->customized
cutom->custom
cutom->custom
cuurently->currently
cxan->cyan
cycic->cyclic
Expand Down Expand Up @@ -3125,8 +3121,7 @@ decalratiosn->declarations
deccelerate->decelerate
decendant->descendant
decendants->descendants
decendent->descendant
decendent->descendent
decendent->descendent, descendant,
decendents->descendants
decideable->decidable
decidely->decidedly
Expand Down Expand Up @@ -4197,7 +4192,7 @@ emegrency->emergency
eminate->emanate
eminated->emanated
emision->emission
emiss->remiss, amiss, amass,
emiss->remiss, amiss, amass,
emissed->amassed, amiss,
emited->emitted
emiting->emitting
Expand Down Expand Up @@ -4744,7 +4739,7 @@ explitly->explicitly
explizit->explicit
explizitly->explicitly
exploititive->exploitative
explot->exploit, explore,
explot->exploit, explore,
explotation->exploitation, exploration,
exploting->exploiting, exploring,
exponetial->exponential
Expand Down Expand Up @@ -4934,7 +4929,7 @@ firey->fiery
firmwware->firmware
firsr->first
firt->first, flirt,
firts->first, flirts,
firts->first, flirts,
fisical->physical, fiscal,
fisionable->fissionable
fisisist->physicist
Expand Down Expand Up @@ -4976,7 +4971,7 @@ foget->forget
fogot->forgot
fogotten->forgotten
folde->folder, fold,
folling->following, falling,
folling->following, falling,
folllow->follow
folllowed->followed
folllowing->following
Expand Down Expand Up @@ -5704,7 +5699,6 @@ imigrated->emigrated, immigrated,
imigration->emigration, immigration,
imilar->similar
iminent->eminent, imminent, immanent,
iminent->imminent
immeadiately->immediately
immedate->immediate
immedately->immediately
Expand Down Expand Up @@ -6281,7 +6275,6 @@ intiailises->initialises
intiailize->initialize
intiailized->initialized
intiailizes->initializes
intiailizing->initialising
intiailizing->initializing
intial->initial
intialisation->initialisation
Expand Down Expand Up @@ -6669,7 +6662,6 @@ mamalian->mammalian
mamory->memory
managable->manageable, manageably,
managment->management
mananged->managed
manangement->management
mandetory->mandatory
maneouvre->manoeuvre
Expand Down Expand Up @@ -7030,8 +7022,7 @@ moent->moment
moeny->money
mofdified->modified
mohammedans->muslims
moil->mohel
moil->soil
moil->soil, mohel,
moint->mount
moleclues->molecules
momemtn->moment
Expand All @@ -7057,19 +7048,17 @@ mordern->modern
moreso->more, more so,
morever->moreover
morgage->mortgage
Morisette->Morissette
morover->moreover
Morrisette->Morissette
morisette->morissette
morrisette->morissette
morroccan->moroccan
morrocco->morocco
morroco->morocco
mortage->mortgage
mose->more
mose->mouse
mose->more, mouse,
moslty->mostly
mosture->moisture
motiviated->motivated
mould->mold, mould, module
mould->mold, mould, module,
mounth->month
mouspointer->mousepointer
movebackwrd->movebackward
Expand Down Expand Up @@ -7283,7 +7272,7 @@ noveau->nouveau
Novermber->November
nowdays->nowadays
nowe->now
nto->not, disable due to \n
nto->not, disabled due to \n
nubmer->number
nubmers->numbers
nucular->nuclear
Expand Down Expand Up @@ -9245,7 +9234,6 @@ sempahore->semaphore
sempahores->semaphores
senario->scenario
senarios->scenarios
sence->sense
sence->sense, since,
sensistive->sensitive
sensistively->sensitively
Expand Down Expand Up @@ -9555,7 +9543,7 @@ specificed->specified
specificiation->specification
specificiations->specifications
specificly->specifically
specificy->specify, specificity, specifically
specificy->specify, specificity, specifically,
specifing->specifying
specifiy->specify
specifiying->specifying
Expand Down Expand Up @@ -10167,7 +10155,7 @@ thikn->think
thikness->thickness
thikning->thinking, thickening,
thikns->thinks
this this->this, this is, is this,
this this->this, this is, is this,
thiunk->think
thn->then
thna->than
Expand Down Expand Up @@ -10244,7 +10232,7 @@ tkaing->taking
tlaking->talking
to to->to, to do,
tobbaco->tobacco
todays->today's, disable because of var names
todays->today's, disabled because of var names
todya->today
togehter->together
toghether->together
Expand Down Expand Up @@ -10890,9 +10878,9 @@ vulnerablility->vulnerability
vyer->very
vyre->very
waht->what
wan't->want, wasn't
wan't->want, wasn't,
wan->want
wan;t->want, wasn't
wan;t->want, wasn't,
wanna->want to, disabled because one might want to allow informal spelling
want's->wants
want;s->wants
Expand Down
Loading

0 comments on commit 50bcf82

Please sign in to comment.