Merge remote-tracking branch 'upstream/master' into ignore-uris
diff --git a/.github/workflows/codespell-private.yml b/.github/workflows/codespell-private.yml
index 9978f04..f79aba6 100644
--- a/.github/workflows/codespell-private.yml
+++ b/.github/workflows/codespell-private.yml
@@ -7,7 +7,13 @@
make-check-dictionaries:
runs-on: ubuntu-latest
steps:
+ - name: Set up Python
+ uses: actions/setup-python@v2
- uses: actions/checkout@v2
+ - name: Install general dependencies
+ run: pip install -U pip wheel # upgrade to latest pip find 3.5 wheels; wheel to avoid errors
+ - name: Install codespell dependencies
+ run: pip install -e ".[dev]"
- uses: codespell-project/sort-problem-matcher@v1
- run: make check-dictionaries
diff --git a/.travis.yml b/.travis.yml
index 0aa105d..94c129b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,23 +29,20 @@
- 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 pytest pytest-cov pytest-dependency flake8 coverage codecov chardet "setuptools!=47.2.0" docutils check-manifest
+ - retry pip install codecov chardet "setuptools!=47.2.0" docutils
- retry pip install aspell-python-py3
- cd $SRC_DIR
+ - pip install -e ".[dev]" # install the codespell dev packages
install:
- python setup.py install
script:
- codespell --help
- - make check-dictionary
- - codespell --skip="codespell_lib/tests/test_basic.py,codespell_lib/data/*" codespell_lib/
+ - make check
+ - codespell --check-filenames --skip="./.git/*,*.pyc,./codespell_lib/tests/test_basic.py,./codespell_lib/data/*,./example/code.c,./build/lib/codespell_lib/tests/test_basic.py,./build/lib/codespell_lib/data/*"
# this file has an error
- "! codespell codespell_lib/tests/test_basic.py"
- - flake8
- - python setup.py check --restructuredtext --strict
- - pytest codespell_lib
- - make check-manifest
after_success:
- codecov
diff --git a/Makefile b/Makefile
index 2313231..9e4b773 100644
--- a/Makefile
+++ b/Makefile
@@ -2,15 +2,17 @@
DICTIONARIES := codespell_lib/data/dictionary*.txt
-PHONY := all check check-dictionaries sort-dictionaries trim-dictionaries check-dictionary sort-dictionary trim-dictionary clean
+PHONY := all check check-dictionaries sort-dictionaries trim-dictionaries check-dictionary sort-dictionary trim-dictionary check-manifest check-distutils flake8 pytest pypi clean
all: check-dictionaries codespell.1
+check: check-dictionaries check-manifest check-distutils flake8 pytest
+
check-dictionary: check-dictionaries
sort-dictionary: sort-dictionaries
trim-dictionary: trim-dictionaries
-codespell.1: codespell.1.include bin/codespell
+codespell.1: codespell.1.include bin/codespell Makefile
PYTHONPATH=. help2man ./bin/codespell --include codespell.1.include --no-info --output codespell.1
sed -i '/\.SS \"Usage/,+2d' codespell.1
@@ -27,6 +29,9 @@
done
@if command -v pytest > /dev/null; then \
pytest codespell_lib/tests/test_dictionary.py; \
+ else \
+ echo "Test dependencies not present, install using 'pip install -e \".[dev]\"'"; \
+ exit 1; \
fi
sort-dictionaries:
@@ -42,6 +47,15 @@
check-manifest:
check-manifest
+check-distutils:
+ python setup.py check --restructuredtext --strict
+
+flake8:
+ flake8
+
+pytest:
+ pytest codespell_lib
+
pypi:
python setup.py sdist register upload
diff --git a/README.rst b/README.rst
index 1052789..9058118 100644
--- a/README.rst
+++ b/README.rst
@@ -78,6 +78,28 @@
echo "word" | codespell -
echo "1stword,2ndword" | codespell -
+Using a config file
+-------------------
+
+Command line options can also be specified in a config file.
+
+When running ``codespell``, it will check in the current directory for a file
+named ``setup.cfg`` or ``.codespellrc`` (or a file specified via ``--config``),
+containing an entry named ``[codespell]``. Each command line argument can
+be specified in this file (without the preceding dashes), for example::
+
+ [codespell]
+ skip = *.po,*.ts,./src/3rdParty,./src/Test
+ count =
+ quiet-level = 3
+
+This is equivalent to running::
+
+ codespell --quiet-level 3 --count --skip "*.po,*.ts,./src/3rdParty,./src/Test"
+
+Any options specified in the command line will *override* options from the
+config file.
+
Dictionary format
-----------------
@@ -107,6 +129,17 @@
Note that there isn't a comma in the end of the line. The last argument is
treated as the reason why a suggestion cannot be automatically applied.
+Development Setup
+-----------------
+
+You can install required dependencies for development by running the following within a checkout of the codespell source::
+
+ pip install -e ".[dev]"
+
+To run tests against the codebase run::
+
+ make check
+
Sending Pull Requests
---------------------
@@ -181,6 +214,7 @@
.. _GPL v2: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-dictionary.txt is a derived work of English Wikipedia and is released under the
-Creative Commons Attribution-Share-Alike License 3.0
+``dictionary.txt`` and the other ``dictionary_*.txt`` files are a derived work of
+English Wikipedia and are released under the Creative Commons
+Attribution-Share-Alike License 3.0
http://creativecommons.org/licenses/by-sa/3.0/
diff --git a/appveyor.yml b/appveyor.yml
index d234a08..79740ca 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -13,7 +13,8 @@
install:
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- - "pip install pytest pytest-cov pytest-dependency setuptools flake8 coverage chardet codecov"
+ - "pip install codecov chardet setuptools"
+ - "pip install -e \".[dev]\"" # install the codespell dev packages
- "python setup.py develop"
build: false # Not a C# project, build stuff at the test step instead.
diff --git a/codecov.yml b/codecov.yml
index db24720..712f948 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -1 +1,8 @@
comment: off
+coverage:
+ status:
+ project:
+ default:
+ # basic
+ target: auto
+ threshold: 1%
diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py
index 90ef32f..f6e8580 100755
--- a/codespell_lib/_codespell.py
+++ b/codespell_lib/_codespell.py
@@ -21,6 +21,7 @@
import argparse
import codecs
+import configparser
import fnmatch
import os
import re
@@ -377,12 +378,39 @@
help='print LINES of leading context')
parser.add_argument('-C', '--context', type=int, metavar='LINES',
help='print LINES of surrounding context')
+ parser.add_argument('--config', type=str,
+ help='path to config file.')
parser.add_argument('files', nargs='*',
help='files or directories to check')
+ # Parse command line options.
options = parser.parse_args(list(args))
+ # Load config files and look for ``codespell`` options.
+ cfg_files = ['setup.cfg', '.codespellrc']
+ if options.config:
+ cfg_files.append(options.config)
+ config = configparser.ConfigParser()
+ config.read(cfg_files)
+
+ if config.has_section('codespell'):
+ # Build a "fake" argv list using option name and value.
+ cfg_args = []
+ for key in config['codespell']:
+ # Add option as arg.
+ cfg_args.append("--%s" % key)
+ # If value is blank, skip.
+ val = config['codespell'][key]
+ if val != "":
+ cfg_args.append(val)
+
+ # Parse config file options.
+ options = parser.parse_args(cfg_args)
+
+ # Re-parse command line options to override config.
+ options = parser.parse_args(list(args), namespace=options)
+
if not options.files:
options.files.append('.')
diff --git a/codespell_lib/data/dictionary.txt b/codespell_lib/data/dictionary.txt
index a9b6f86..969a0e9 100644
--- a/codespell_lib/data/dictionary.txt
+++ b/codespell_lib/data/dictionary.txt
@@ -56,7 +56,7 @@
abnornally->abnormally
abnove->above
abnrormal->abnormal
-aboce->above
+aboce->above, abode,
abolute->absolute
abondon->abandon
abondoned->abandoned
@@ -445,6 +445,8 @@
accuratley->accurately
accuratly->accurately
accuray->accuracy, actuary,
+accure->accrue, occur, acquire,
+accured->accrued, occurred, acquired,
accurences->occurrences
accurracy->accuracy
accurring->occurring
@@ -567,9 +569,10 @@
acqure->acquire
acqured->acquired
acqures->acquires
+acquries->acquires, equerries,
acquring->acquiring
acrage->acreage
-acrued->accured
+acrued->accrued
acses->cases, access,
acssumed->assumed
actally->actually
@@ -737,7 +740,7 @@
adivsoriy->advisory, advisories,
adivsoriyes->advisories
adivsory->advisory
-adjacentcy->adjacence
+adjacentcy->adjacency, adjacence,
adjacentsy->adjacency
adjactend->adjacent
adjancent->adjacent
@@ -860,7 +863,8 @@
affilate->affiliate
affilates->affiliates
affilliate->affiliate
-affinitied->affinitized
+affinitied->affinities
+affinitized->affinities, affinity,
affinitze->affinitize
affintize->affinitize
affitnity->affinity
@@ -1424,7 +1428,7 @@
alrogithm->algorithm
alrteady->already
als->also
-alse->also, else,
+alse->also, else, false,
alsmost->almost
alsot->also
alsready->already
@@ -1561,6 +1565,11 @@
analouge->analogue
analouges->analogues
analsyis->analysis
+analye->analyse, analyze,
+analyed->analysed, analyzed,
+analyer->analyser, analyzer,
+analyers->analysers, analyzers,
+analyes->analyses, analyzes, analyse, analyze,
analyis->analysis
analysator->analyser
analysies->analyses, analysis,
@@ -2032,7 +2041,7 @@
aquisition->acquisition
aquit->acquit
aquitted->acquitted
-aquries->acquries
+aquries->acquires, equerries,
arameters->parameters
aranged->arranged
arangement->arrangement
@@ -2574,8 +2583,11 @@
assymetric->asymmetric
assymetrical->asymmetrical
assymetries->asymmetries
+assymetry->asymmetry
assymmetric->asymmetric
assymmetrical->asymmetrical
+assymmetries->asymmetries
+assymmetry->asymmetry
asterices->asterisks
asteriks->asterisk, asterisks,
asteriod->asteroid
@@ -2592,15 +2604,19 @@
asumption->assumption
asure->assure
aswell->as well
+asychronize->asynchronize
+asychronized->asynchronized
+asychronous->asynchronous
asychronously->asynchronously
+asycn->async
asycronous->asynchronous
asymetic->asymmetric
-asymetri->assymetry
+asymetri->asymmetric, asymmetry,
asymetric->asymmetric
asymetrical->asymmetrical
asymetricaly->asymmetrically
asymmeric->asymmetric
-asymmetri->asymmetric
+asymmetri->asymmetric, asymmetry,
asynchnous->asynchronous
asynchonous->asynchronous
asynchonously->asynchronously
@@ -2631,6 +2647,10 @@
atempt->attempt
atempting->attempting
atempts->attempts
+atendance->attendance
+atended->attended
+atendee->attendee
+atention->attention
atheistical->atheistic
athenean->athenian
atheneans->athenians
@@ -2642,6 +2662,8 @@
athros->atheros
atleast->at least
atll->all
+atmoic->atomic
+atmoically->atomically
atomatically->automatically
atomical->atomic
atomicly->atomically
@@ -3254,7 +3276,7 @@
avriants->variants
avtive->active
awared->awarded
-aways->always
+aways->always, away,
aweful->awful
awefully->awfully
awnser->answer
@@ -5042,7 +5064,6 @@
cloesd->closed
cloesed->closed
cloesing->closing
-cloneable->clonable
clonez->clones, cloner,
clonning->cloning
clory->glory
@@ -5226,6 +5247,10 @@
cofriming->confirming
cofrims->confirms
cognizent->cognizant
+coherance->coherence
+coherancy->coherency
+coherant->coherent
+coherantly->coherently
coice->choice
coincedentally->coincidentally
coinitailize->coinitialize
@@ -5289,7 +5314,7 @@
colomns->columns
colon-seperated->colon-separated
colonizators->colonizers
-colorfull->colorful
+colorfull->colorful, colorfully,
coloringh->coloring
colorizoer->colorizer
colorpsace->colorspace
@@ -5299,6 +5324,7 @@
coloumn->column
coloumns->columns
coloums->columns
+colourfull->colourful, colourfully,
colourpsace->colourspace
colourpsaces->colourspaces
colsed->closed
@@ -5698,6 +5724,7 @@
compatiability->compatibility
compatiable->compatible
compatiablity->compatibility
+compatibel->compatible
compatibile->compatible
compatibiliy->compatibility
compatibilty->compatibility
@@ -6462,6 +6489,8 @@
constantsm->constants
constarnation->consternation
constatn->constant
+constatnt->constant
+constatnts->constants
constcurts->constructs
constext->context
consting->consisting
@@ -6507,7 +6536,7 @@
constriants->constraints
constrollers->controllers
construc->construct
-construced->construtced
+construced->constructed, construed,
construces->constructs
construcing->constructing
construcion->construction
@@ -6531,6 +6560,7 @@
construnctor->constructor
construrtors->constructors
construt->construct
+construtced->constructed
construter->constructor
construters->constructors
constrution->construction
@@ -6832,8 +6862,7 @@
conveting->converting
convetion->convention
convets->converts
-convexe->convex
-convexes->convex
+convexe->convex, convexes,
conveyer->conveyor
conviced->convinced
convience->convince, convenience,
@@ -7216,7 +7245,8 @@
counterpar->counterpart
counterpoart->counterpart
countie's->counties, counties', county's,
-countinueq->continueq
+countinue->continue
+countinueq->continueq, continue,
countires->countries, counties,
countour->contour, counter,
countours->contours, counters,
@@ -7392,6 +7422,7 @@
cuestions->questions
cuileoga->cuileog
culiminating->culminating
+cumlative->cumulative
cummand->command
cummulative->cumulative
cummunicate->communicate
@@ -7497,6 +7528,7 @@
dadlock->deadlock
daed->dead
dael->deal, dial, dahl,
+daemonified->daemonised, daemonized,
dafault->default
dafaults->defaults
dafaut->default
@@ -7639,7 +7671,7 @@
deamiguates->disambiguates
deamiguation->disambiguation
deamon->daemon
-deamonified->daemonified
+deamonified->daemonised, daemonized,
deamonisation->daemonisation
deamonise->daemonise
deamonised->daemonised
@@ -7878,7 +7910,6 @@
dedly->deadly
deductable->deductible
deductables->deductibles
-dedup->dedupe
deduplacate->deduplicate
deduplacated->deduplicated
deduplacates->deduplicates
@@ -8648,6 +8679,8 @@
desturcted->destructed
desturtor->destructor
desturtors->destructors
+desychronize->desynchronize
+desychronized->desynchronized
detabase->database
detachs->detaches
detahced->detached
@@ -9584,6 +9617,12 @@
distinquish->distinguish
distinquishable->distinguishable
distintions->distinctions
+distirbute->distribute
+distirbuted->distributed
+distirbutes->distributes
+distirbuting->distributing
+distirbution->distribution
+distirbutions->distributions
distirted->distorted
distnace->distance
distnaces->distances
@@ -9780,7 +9819,7 @@
dorment->dormant
dorp->drop
dosen't->doesn't
-dosen->doesn
+dosen->dozen, dose, doesn,
dosen;t->doesn't
dosens->dozens
dosent'->doesn't
@@ -10019,6 +10058,8 @@
earler->earlier
earliear->earlier
earlies->earliest
+earlist->earliest
+earlyer->earlier
earnt->earned
earpeice->earpiece
easer->easier, eraser,
@@ -10050,6 +10091,10 @@
ecspecially->especially
ect->etc
ecxept->except
+ecxite->excite
+ecxited->excited
+ecxites->excites
+ecxiting->exciting
ecxtracted->extracted
EDCDIC->EBCDIC
edditable->editable
@@ -11419,6 +11464,9 @@
existung->existing
existy->exist
existying->existing
+exitation->excitation
+exitations->excitations
+exite->exit, excite, exits,
exixst->exist
exixt->exist
exlamation->exclamation
@@ -12233,9 +12281,9 @@
facorites->favorites
facors->favors, fakers,
facour->favour, favor,
-facourite->favourite, favorite,
-facourites->favuourites, favorites,
-facours->favours, favors,
+facourite->favourite
+facourites->favourites
+facours->favours
factization->factorization
factorizaiton->factorization
factorys->factories
@@ -12281,6 +12329,7 @@
fallhrough->fallthrough
fallthruogh->fallthrough
falltrough->fallthrough
+falsly->falsely
falt->fault
falure->failure
familar->familiar
@@ -12316,9 +12365,11 @@
fatser->faster
fature->feature
faught->fought
+fauilure->failure
fauilures->failures
-faund->found
+faund->found, fund,
favoutrable->favourable
+favuourites->favourites
faymus->famous
fcound->found
feasabile->feasible
@@ -12404,7 +12455,6 @@
fileld->field
filelds->fields
filenae->filename
-files'->file's
fileshystem->filesystem
fileshystems->filesystems
filesname->filename, filenames,
@@ -12508,15 +12558,25 @@
fisisist->physicist
fisist->physicist
fisrt->first
-fiter->filter, fighter,
+fiter->filter, fighter, fitter, fiver,
fitering->filtering
-fiters->filters, fighters,
+fiters->filters, fighters, fitters, fivers,
fitler->filter
fitlers->filters
fivety->fifty
fixe->fixed, fixes, fix, fixme, fixer,
fixeme->fixme
fizeek->physique
+flacor->flavor
+flacored->flavored
+flacoring->flavoring
+flacorings->flavorings
+flacors->flavors
+flacour->flavour
+flacoured->flavoured
+flacouring->flavouring
+flacourings->flavourings
+flacours->flavours
flage->flags
flaged->flagged
flages->flags
@@ -12526,7 +12586,7 @@
flaot->float
flaoting->floating
flashflame->flashframe
-flass->class, flask,
+flass->class, glass, flask, flash,
flate->flat
flatened->flattened
flattend->flattened
@@ -12539,7 +12599,8 @@
flewant->fluent
flexability->flexibility
flexable->flexible
-flexibel->flexibele
+flexibel->flexible
+flexibele->flexible
flexibilty->flexibility
flext->flex
flie->file
@@ -12853,6 +12914,8 @@
fortelling->foretelling
forthcominng->forthcoming
forthcomming->forthcoming
+fortunaly->fortunately
+fortunat->fortunate
fortunatly->fortunately
fortunetly->fortunately
forula->formula
@@ -12875,7 +12938,7 @@
forwared->forwarded, forward,
forwaring->forwarding
forwwarded->forwarded
-fot->for
+fot->for, fit, dot, rot, cot, got, tot, fog,
foto->photo
fotograf->photograph
fotografic->photographic
@@ -13120,7 +13183,6 @@
fysisit->physicist
gabage->garbage
gadged->gadget, gauged,
-gae->game, Gael, gale,
galatic->galactic
Galations->Galatians
gallaries->galleries
@@ -13955,7 +14017,11 @@
homestate->home state
homogeneize->homogenize
homogeneized->homogenized
+homogenious->homogeneous
+homogeniously->homogeneously
homogenity->homogeneity
+homogenius->homogeneous
+homogeniusly->homogeneously
homogenoues->homogeneous
homogenous->homogeneous
homogenously->homogeneously
@@ -14125,7 +14191,7 @@
idenitify->identify
identation->indentation
identcial->identical
-identiable->identificable
+identiable->identifiable
idential->identical
identicial->identical
identidier->identifier
@@ -14135,6 +14201,7 @@
identifeirs->identifiers
identifer->identifier
identifers->identifiers
+identificable->identifiable
identifictaion->identification
identifieer->identifier
identifing->identifying
@@ -14240,6 +14307,11 @@
illution->illusion
ilness->illness
ilogical->illogical
+iluminate->illuminate
+iluminated->illuminated
+iluminates->illuminates
+ilumination->illumination
+iluminations->illuminations
ilustrate->illustrate
ilustrated->illustrated
ilustration->illustration
@@ -14621,6 +14693,10 @@
inclused->included
inclusinve->inclusive
incmrement->increment
+incoherance->incoherence
+incoherancy->incoherency
+incoherant->incoherent
+incoherantly->incoherently
incomapatibility->incompatibility
incomapatible->incompatible
incomaptible->incompatible
@@ -14794,6 +14870,7 @@
indentified->identified
indentifier->identifier
indentifies->identifies
+indentifing->identifying
indentify->identify
indentifying->identifying
indentit->identity
@@ -15443,11 +15520,16 @@
intendet->intended
inteneded->intended
intension->intention
+intensional->intentional
+intensionally->intentionally
+intensionaly->intentionally
intensitive->insensitive, intensive,
intentation->indentation
intented->intended, indented,
intentended->intended
intentially->intentionally
+intentialy->intentionally
+intentionaly->intentionally
intepolate->interpolate
intepolated->interpolated
intepolates->interpolates
@@ -15542,6 +15624,8 @@
interessted->interested
interessting->interesting
intereview->interview
+interfal->interval
+interfals->intervals
interfave->interface
interfaves->interfaces
interfcae->interface
@@ -15861,8 +15945,12 @@
iresistible->irresistible
iresistibly->irresistibly
iritable->irritable
+iritate->irritate
iritated->irritated
+iritating->irritating
ironicly->ironically
+irradate->irradiate
+irradation->irradiation
irregularties->irregularities
irregulier->irregular
irregulierties->irregularities
@@ -15911,8 +15999,14 @@
isue->issue
iteartor->iterator
iteger->integer
+itegral->integral
+itegrals->integrals
iten->item
itens->items
+itention->intention
+itentional->intentional
+itentionally->intentionally
+itentionaly->intentionally
iterater->iterator
iteratered->iterated
iteratons->iterations
@@ -16054,7 +16148,6 @@
keyowrd->keyword
keypair->key pair
keypairs->key pairs
-keyserver->key server
keyservers->key servers
keystokes->keystrokes
keyward->keyword
@@ -16529,7 +16622,7 @@
lsat->last
lsit->list
lsits->lists
-lukid->likud
+lukid->lucid, Likud,
luminose->luminous
luminousity->luminosity
lveo->love
@@ -16863,6 +16956,7 @@
meaninng->meaning
mear->wear, mere, mare,
mearly->merely, nearly,
+measurd->measured, measure,
measuremenet->measurement
measuremenets->measurements
measurmenet->measurement
@@ -16906,7 +17000,8 @@
medevial->medieval
medhod->method
medhods->methods
-mediciney->mediciny
+mediciney->medicine, medicinal,
+mediciny->medicine, medicinal,
medievel->medieval
mediterainnean->mediterranean
Mediteranean->Mediterranean
@@ -17005,9 +17100,9 @@
messsage->message
messsages->messages
messure->measure
-messured->measurd
+messured->measured
messurement->measurement
-messures->measure
+messures->measures
messuring->measuring
messurment->measurement
mesure->measure
@@ -17191,8 +17286,8 @@
mininal->minimal
mininum->minimum
miniscule->minuscule
-miniscully->minusculy
-ministery->ministry
+miniscully->minusculely
+ministery->ministry, minister,
miniture->miniature
minium->minimum
miniums->minimums
@@ -17209,9 +17304,14 @@
minum->minimum
minumum->minimum
minuscle->minuscule
+minusculy->minusculely, minuscule,
minuts->minutes
miplementation->implementation
mirconesia->micronesia
+mircophone->microphone
+mircophones->microphones
+mircoscope->microscope
+mircoscopes->microscopes
mircosoft->Microsoft
mirgate->migrate
mirgated->migrated
@@ -18491,7 +18591,6 @@
objetc->object
objetcs->objects
objets->objects
-objext->object
objtain->obtain
objtained->obtained
objtains->obtains
@@ -18601,7 +18700,6 @@
ocurred->occurred
ocurrence->occurrence
ocurrences->occurrences
-od->of
oder->order, odor,
odly->oddly
oen->one
@@ -19608,7 +19706,7 @@
peirodical->periodical
peirodicals->periodicals
peirods->periods
-Peloponnes->Peloponnesus
+Peloponnes->Peloponnese, Peloponnesus,
penalities->penalties
penality->penalty
penatly->penalty
@@ -19753,7 +19851,6 @@
permuations->permutations
permutaion->permutation
permutaions->permutations
-permuter->permutor
peroendicular->perpendicular
perogative->prerogative
peroid->period
@@ -19797,8 +19894,19 @@
persuit->pursuit
persuits->pursuits
persumably->presumably
+pertrub->perturb
+pertrubation->perturbation
+pertrubations->perturbations
+pertrubing->perturbing
+pertub->perturb
+pertubate->perturb
+pertubated->perturbed
+pertubates->perturbs
pertubation->perturbation
pertubations->perturbations
+pertubing->perturbing
+perturbate->perturb
+perturbates->perturbs
pervious->previous
perviously->previously
pessiary->pessary
@@ -19918,6 +20026,7 @@
plausability->plausibility
plausable->plausible
playble->playable
+playfull->playful, playfully,
playge->plague
playgerise->plagiarise
playgerize->plagiarize
@@ -20137,10 +20246,10 @@
positoin->position
positoined->positioned
positoins->positions
-positon->position
+positon->position, positron,
positoned->positioned
positoning->positioning
-positons->positions
+positons->positions, positrons,
positve->positive
positves->positives
POSIX-complient->POSIX-compliant
@@ -20660,11 +20769,14 @@
problmes->problems
probly->probably
procceed->proceed
+proccesor->processor
proccesors->processors
proccess->process
proccessed->processed
proccesses->processes
proccessing->processing
+proccessor->processor
+proccessors->processors
procecure->procedure
procecures->procedures
procede->proceed, precede,
@@ -20692,7 +20804,6 @@
proceshandler->processhandler
procesing->processing
procesor->processor
-process'->process's
processeed->processed
processees->processes
processer->processor
@@ -20829,12 +20940,15 @@
programatic->programmatic
programatically->programmatically
programattically->programmatically
+programd->programmed
+programed->programmed
programemer->programmer
programemers->programmers
programers->programmers
programing->programming
-programm->program
+programm->program, programme,
programmaticaly->programmatically
+programmd->programmed, programme,
programmend->programmed
programmetically->programmatically
programmical->programmatical
@@ -21297,8 +21411,10 @@
rabinnical->rabbinical
racaus->raucous
ractise->practise
+radation->radiation
rade->read, raid,
radiactive->radioactive
+radiaton->radiation
radify->ratify
radiobuttion->radiobutton
radis->radix
@@ -21995,6 +22111,11 @@
redirectd->redirected
redirectrion->redirection
redisign->redesign
+redistirbute->redistribute
+redistirbuted->redistributed
+redistirbutes->redistributes
+redistirbuting->redistributing
+redistirbution->redistribution
redliens->redlines
rednerer->renderer
redonly->readonly
@@ -23116,6 +23237,9 @@
restoiring->restoring
restor->restore
restorated->restored
+restoreable->restorable
+restoreble->restorable
+restoreing->restoring
restors->restores
restouration->restoration
restraunt->restraint, restaurant,
@@ -23667,6 +23791,7 @@
scraching->scratching
scrachs->scratches
scrao->scrap
+screem->scream, screen,
screenchot->screenshot
screenchots->screenshots
screenwrighter->screenwriter
@@ -23757,6 +23882,8 @@
secuely->securely
secuity->security
secund->second
+securiy->security
+securiyt->security
securly->securely
securre->secure
securrely->securely
@@ -23880,6 +24007,8 @@
sensistive->sensitive
sensistively->sensitively, sensitivity,
sensitiv->sensitive
+sensitiveties->sensitivities
+sensitivety->sensitivity
sensitivties->sensitivities
sensitivty->sensitivity
sensitivy->sensitivity, sensitively,
@@ -24477,6 +24606,7 @@
situatutions->situations
situbbornness->stubbornness
situdio->studio
+situdios->studios
siturations->situations
situtation->situation
situtations->situations
@@ -24610,6 +24740,7 @@
somehwere->somewhere
somehwo->somehow
somelse->someone else
+somemore->some more
somene->someone
somenone->someone
someon->someone
@@ -25294,9 +25425,12 @@
stopps->stops
stopry->story
storag->storage
+storeable->storable
storeage->storage
stoream->stream
-storeis->stories
+storeble->storable
+storeing->storing
+storeis->stories, stores, store is, storeys,
storise->stories
stornegst->strongest
stoyr->story
@@ -25306,6 +25440,8 @@
stradegy->strategy
stragedy->strategy
stragegy->strategy
+strageties->strategies
+stragety->strategy
straigh-forward->straightforward
straighforward->straightforward
straightfoward->straightforward
@@ -25423,9 +25559,14 @@
stuctured->structured
stuctures->structures
studdy->study
-studi->study
+studi->study, studio,
studing->studying
+studis->studies, studios,
+studoi->studio
+studois->studios
stuggling->struggling
+stuido->studio
+stuidos->studios
stuill->still
stummac->stomach
sturcture->structure
@@ -25545,7 +25686,6 @@
subpecies->subspecies
subporgram->subprogram
subproccese->subprocess
-subprocess'->subprocess's
subpsace->subspace
subquue->subqueue
subract->subtract
@@ -26011,6 +26151,7 @@
swaped->swapped
swapiness->swappiness
swaping->swapping
+swarmin->swarming
swcloumns->swcolumns
swepth->swept
swich->switch
@@ -26047,8 +26188,21 @@
syatems->systems
sybsystem->subsystem
sybsystems->subsystems
+sychronisation->synchronisation
+sychronise->synchronise
+sychronised->synchronised
+sychroniser->synchroniser
+sychronises->synchronises
sychronisly->synchronously
+sychronization->synchronization
+sychronize->synchronize
+sychronized->synchronized
+sychronizer->synchronizer
+sychronizes->synchronizes
sychronmode->synchronmode
+sychronous->synchronous
+sychronously->synchronously
+sycn->sync
sycology->psychology
sycronise->synchronise
sycronised->synchronised
@@ -26121,9 +26275,9 @@
synchronuous->synchronous
synchronuously->synchronously
synchronus->synchronous
-syncrhonise->sychronise
+syncrhonise->synchronise
syncrhonised->synchronised
-syncrhonize->sychronize
+syncrhonize->synchronize
syncrhonized->synchronized
syncronise->synchronise
syncronised->synchronised
@@ -26251,6 +26405,10 @@
talbe->table
talekd->talked
tallerable->tolerable
+tamplate->template
+tamplated->templated
+tamplates->templates
+tamplating->templating
tangeant->tangent
tangeantial->tangential
tangeants->tangents
@@ -26312,7 +26470,7 @@
tcahce->cache
tcahces->caches
tcheckout->checkout
-te->the, be,
+te->the, be, we,
teached->taught
teachnig->teaching
teamplate->template
@@ -26495,6 +26653,7 @@
tendancies->tendencies
tendancy->tendency
tennisplayer->tennis player
+tention->tension
teplmate->template
teplmated->templated
teplmates->templates
@@ -26795,9 +26954,11 @@
timeputs->timeouts, time puts,
timere->timer
timeschedule->time schedule
+timespanp->timespan
+timespanps->timespans
timestan->timespan
-timestanp->timespanp
-timestanps->timespanps
+timestanp->timestamp, timespan,
+timestanps->timestamps, timespans,
timestans->timespans
timestemp->timestamp
timestemps->timestamps
@@ -26925,6 +27086,10 @@
trafficing->trafficking
trafic->traffic
tragectory->trajectory
+traget->target
+trageted->targeted
+trageting->targeting
+tragets->targets
traiing->trailing, training,
trailling->trailing
traker->tracker
@@ -27144,8 +27309,11 @@
transprently->transparently
transprot->transport
transproted->transported
+transproting->transporting
transprots->transports
transprt->transport
+transprted->transported
+transprting->transporting
transprts->transports
transpsition->transposition
transsend->transcend
@@ -27161,6 +27329,8 @@
transvorming->transforming
transvorms->transforms
tranversing->traversing
+trapeziod->trapezoid
+trapeziodal->trapezoidal
trasaction->transaction
trascation->transaction
trasfer->transfer
@@ -27317,6 +27487,7 @@
trustworthyness->trustworthiness
trustworty->trustworthy
trustwortyness->trustworthiness
+truw->true
tryed->tried
tryes->tries
tryig->trying
@@ -27573,6 +27744,7 @@
undefied->undefined
undefien->undefine
undefiend->undefined
+undefinied->undefined
undeflow->underflow
undeflows->underflows
undefuned->undefined
@@ -27706,6 +27878,8 @@
unfortuante->unfortunate
unfortuantely->unfortunately
unfortunaltely->unfortunately
+unfortunaly->unfortunately
+unfortunat->unfortunate
unfortunatelly->unfortunately
unfortunatetly->unfortunately
unfortunatley->unfortunately
@@ -27897,6 +28071,8 @@
unpacke->unpacked
unpacket->unpacked
unparseable->unparsable
+unpertubated->unperturbed
+unperturbated->unperturbed
unplease->displease
unpleasent->unpleasant
unplesant->unpleasant
@@ -28108,7 +28284,10 @@
unsurprizingly->unsurprisingly
unsused->unused
unswithced->unswitched
+unsychronise->unsynchronise
unsychronised->unsynchronised
+unsychronize->unsynchronize
+unsychronized->unsynchronized
untargetted->untargeted
unter->under
untill->until
@@ -28861,7 +29040,6 @@
wendesday->Wednesday
wendsay->Wednesday
wensday->Wednesday
-were'->we're
were'nt->weren't
wereabouts->whereabouts
wereas->whereas
@@ -28989,6 +29167,8 @@
windos->windows
windwo->window
winn->win
+winndow->window
+winndows->windows
winodw->window
wipoing->wiping
wirded->wired, weird,
diff --git a/codespell_lib/data/dictionary_code.txt b/codespell_lib/data/dictionary_code.txt
index fbaa9e2..296dcbe 100644
--- a/codespell_lib/data/dictionary_code.txt
+++ b/codespell_lib/data/dictionary_code.txt
@@ -1,18 +1,29 @@
amin->main
+atend->attend
+atending->attending
cas->case, cast,
clas->class
+cloneable->clonable
cmo->com
+copyable->copiable
define'd->defined
dof->of, doff,
dont->don't
endcode->encode
errorstring->error string
+files'->file's
+gae->game, Gael, gale,
iam->I am, aim,
iff->if
ith->with
+keyserver->key server
+lateset->latest
movei->movie
mut->must, mutt, moot,
nto->not
+objext->object
+od->of
+process'->process's
referer->referrer
rela->real
secant->second
@@ -20,7 +31,13 @@
seeked->sought
sinc->sync, sink, since,
sincs->syncs, sinks, since,
+stdio->studio
+stdios->studios
stoll->still
+storaged->storage, stored,
+storaget->storage
+subprocess'->subprocess's
thead->thread
todays->today's
uint->unit
+were'->we're
diff --git a/codespell_lib/data/dictionary_en-GB_to_en-US.txt b/codespell_lib/data/dictionary_en-GB_to_en-US.txt
index ba32712..9d33381 100644
--- a/codespell_lib/data/dictionary_en-GB_to_en-US.txt
+++ b/codespell_lib/data/dictionary_en-GB_to_en-US.txt
@@ -1,5 +1,10 @@
acknowledgement->acknowledgment
+acknowledgements->acknowledgments
+amortise->amortize
amortised->amortized
+amortises->amortizes
+amortising->amortizing
+analogue->analog
analyse->analyze
analysed->analyzed
analyser->analyzer
@@ -10,35 +15,81 @@
artefacts->artifacts
authorisation->authorization
authorise->authorize
+authorised->authorized
+authorises->authorizes
+authorising->authorizing
behaviour->behavior
behaviours->behaviors
cancelled->canceled
cancelling->canceling
+capitalisation->capitalization
capitalise->capitalize
+capitalised->capitalized
+capitalises->capitalizes
+capitalising->capitalizing
catalogue->catalog
+catalogues->catalogs
centimetre->centimeter
centimetres->centimeters
+centralisation->centralization
centralise->centralize
+centralised->centralized
+centralises->centralizes
+centralising->centralizing
centre->center
+centres->centers
characterisation->characterization
+characterise->characterize
characterised->characterized
+characterises->characterizes
+characterising->characterizing
colour->color
+colourful->colorful
+colourfully->colorfully
colouring->coloring
colours->colors
counsellor->counselor
criticise->criticize
criticised->criticized
criticises->criticizes
+criticising->criticizing
crystallisation->crystallization
+crystallise->crystallize
+crystallised->crystallized
+crystallises->crystallizes
+crystallising->crystallizing
+customisation->customization
+customise->customize
customised->customized
+customises->customizes
customising->customizing
defence->defense
+demonise->demonize
+demonised->demonized
+demonises->demonizes
+demonising->demonizing
dialogue->dialog
+digitisation->digitization
digitise->digitize
+digitised->digitized
+digitises->digitizes
digitising->digitizing
+emphasise->emphasize
emphasised->emphasized
+emphasises->emphasizes
+emphasising->emphasizing
endeavour->endeavor
+endeavours->endeavors
+favour->favor
+favourite->favorite
+favourites->favorites
+favouritism->favoritism
+favours->favors
+finalisation->finalization
finalise->finalize
+finalised->finalized
+finalises->finalizes
+finalising->finalizing
flavour->flavor
flavours->flavors
fulfil->fulfill
@@ -48,23 +99,35 @@
generalise->generalize
generalised->generalized
generalises->generalizes
+generalising->generalizing
honour->honor
+honours->honors
initialisation->initialization
initialise->initialize
initialised->initialized
initialises->initializes
initialising->initializing
judgement->judgment
+judgements->judgments
kilometre->kilometer
kilometres->kilometers
labelled->labeled
labelling->labeling
labour->labor
+legalisation->legalization
legalise->legalize
+legalised->legalized
+legalises->legalizes
+legalising->legalizing
licence->license
+licences->licenses
manoeuvre->maneuver
manoeuvres->maneuvers
+memorisation->memorization
memorise->memorize
+memorised->memorized
+memorises->memorizes
+memorising->memorizing
metre->meter
metres->meters
millimetre->millimeter
@@ -78,58 +141,121 @@
modelled->modeled
modelling->modeling
mould->mold
+moulds->molds
nasalisation->nasalization
neighbour->neighbor
neighbours->neighbors
+normalisation->normalization
normalise->normalize
normalised->normalized
normalises->normalizes
+normalising->normalizing
optimisation->optimization
optimisations->optimizations
+optimise->optimize
optimised->optimized
optimiser->optimizer
+optimises->optimizes
+optimising->optimizing
organisation->organization
organisations->organizations
organise->organize
organised->organized
+organiser->organizer
+organisers->organizers
+organises->organizes
+organising->organizing
plagiarise->plagiarize
+plagiarised->plagiarized
+plagiarises->plagiarizes
+plagiarising->plagiarizing
+polarise->polarize
+polarised->polarized
+polarises->polarizes
+polarising->polarizing
practise->practice
+prioritisation->prioritization
prioritise->prioritize
+prioritised->prioritized
+prioritises->prioritizes
prioritising->prioritizing
publicise->publicize
+publicised->publicized
+publicises->publicizes
+publicising->publicizing
+realisation->realization
realise->realize
realised->realized
+realises->realizes
+realising->realizing
recognise->recognize
recognised->recognized
recognises->recognizes
+recognising->recognizing
regularisation->regularization
regularise->regularize
regularised->regularized
regularises->regularizes
+regularising->regularizing
reinitialise->reinitialize
reinitialised->reinitialized
reorganisation->reorganization
+reorganise->reorganize
reorganised->reorganized
+reorganises->reorganizes
+reorganising->reorganizing
sanitise->sanitize
sanitised->sanitized
+sanitiser->sanitizer
+sanitises->sanitizes
+sanitising->sanitizing
serialisation->serialization
serialise->serialize
+serialised->serialized
+serialises->serializes
+serialising->serializing
skilful->skillful
skilfully->skillfully
skilfulness->skillfulness
+specialisation->specialization
specialise->specialize
specialised->specialized
+specialises->specializes
+specialising->specializing
splendour->splendor
standardisation->standardization
+standardise->standardize
standardised->standardized
+standardises->standardizes
+standardising->standardizing
+sterilisation->sterilization
+sterilise->sterilize
+sterilised->sterilized
+steriliser->sterilizer
+sterilises->sterilizes
+sterilising->sterilizing
+summarise->summarize
summarised->summarized
+summarises->summarizes
+summarising->summarizing
synchronisation->synchronization
synchronise->synchronize
synchronised->synchronized
synchronises->synchronizes
+synchronising->synchronizing
unauthorised->unauthorized
+unorganised->unorganized
unrecognised->unrecognized
+utilisation->utilization
utilise->utilize
utilised->utilized
+utilises->utilizes
+utilising->utilizing
virtualisation->virtualization
visualisation->visualization
+visualisations->visualizations
+visualise->visualize
+visualised->visualized
+visualiser->visualizer
+visualises->visualizes
+visualising->visualizing
diff --git a/codespell_lib/data/dictionary_names.txt b/codespell_lib/data/dictionary_names.txt
index a9113db..53a1f18 100644
--- a/codespell_lib/data/dictionary_names.txt
+++ b/codespell_lib/data/dictionary_names.txt
@@ -1,3 +1,4 @@
+aldo->also
ang->and
anny->any
bae->base
diff --git a/codespell_lib/data/dictionary_rare.txt b/codespell_lib/data/dictionary_rare.txt
index 973931e..287e1ea 100644
--- a/codespell_lib/data/dictionary_rare.txt
+++ b/codespell_lib/data/dictionary_rare.txt
@@ -24,7 +24,6 @@
consequentially->consequently
coo->coup
copping->coping, copying, cropping,
-copyable->copiable
crasher->crash
crashers->crashes
crate->create
@@ -78,6 +77,7 @@
loos->loose, lose,
loosing->losing
lousily->loosely
+lumination->lamination, illumination,
manger->manager
marge->merge
mater->matter, master, mother,
diff --git a/codespell_lib/tests/test_basic.py b/codespell_lib/tests/test_basic.py
index 1c5208a..29c5de7 100644
--- a/codespell_lib/tests/test_basic.py
+++ b/codespell_lib/tests/test_basic.py
@@ -729,6 +729,39 @@
assert not uri_regex.findall(boilerplate % uri), uri
+def test_config(tmpdir, capsys):
+ """
+ Tests loading options from a config file.
+ """
+ d = str(tmpdir)
+
+ # Create sample files.
+ with open(op.join(d, 'bad.txt'), 'w') as f:
+ f.write('abandonned donn\n')
+ with open(op.join(d, 'good.txt'), 'w') as f:
+ f.write("good")
+
+ # Create a config file.
+ conffile = op.join(d, 'config.cfg')
+ with open(conffile, 'w') as f:
+ f.write(
+ '[codespell]\n'
+ 'skip = bad.txt\n'
+ 'count = \n'
+ )
+
+ # Should fail when checking both.
+ code, stdout, _ = cs.main(d, count=True, std=True)
+ # Code in this case is not exit code, but count of misspellings.
+ assert code == 2
+ assert 'bad.txt' in stdout
+
+ # Should pass when skipping bad.txt
+ code, stdout, _ = cs.main('--config', conffile, d, count=True, std=True)
+ assert code == 0
+ assert 'bad.txt' not in stdout
+
+
@contextlib.contextmanager
def FakeStdin(text):
if sys.version[0] == '2':
diff --git a/codespell_lib/tests/test_dictionary.py b/codespell_lib/tests/test_dictionary.py
index d840ea7..c3a26bd 100644
--- a/codespell_lib/tests/test_dictionary.py
+++ b/codespell_lib/tests/test_dictionary.py
@@ -110,13 +110,17 @@
if rep.count(','):
assert rep.endswith(','), ('error %s: multiple corrections must end '
'with trailing ","' % (err,))
- reps = [r.strip() for r in rep.lower().split(',')]
+ reps = [r.strip() for r in rep.split(',')]
reps = [r for r in reps if len(r)]
for r in reps:
assert err != r.lower(), ('error %r corrects to itself amongst others'
% (err,))
_check_aspell(
r, 'error %s: correction %r' % (err, r), in_aspell[1], fname)
+ # aspell dictionary is case sensitive, so pass the original case into there
+ # we could ignore the case, but that would miss things like days of the
+ # week which we want to be correct
+ reps = [r.lower() for r in reps]
assert len(set(reps)) == len(reps), ('error %s: corrections "%s" are not '
'(lower-case) unique' % (err, rep))
@@ -134,7 +138,7 @@
('a', 'bar, bat', 'must end with trailing ","'),
('a', 'a, bar,', 'corrects to itself amongst others'),
('a', 'a', 'corrects to itself'),
- ('a', 'bar, bar,', 'unique'),
+ ('a', 'bar, Bar,', 'unique'),
])
def test_error_checking(err, rep, match):
"""Test that our error checking works."""
@@ -142,7 +146,7 @@
_check_err_rep(err, rep, (None, None), 'dummy')
-@pytest.mark.skipif(speller is None, reason='requires aspell')
+@pytest.mark.skipif(speller is None, reason='requires aspell-en')
@pytest.mark.parametrize('err, rep, err_aspell, rep_aspell, match', [
# This doesn't raise any exceptions, so skip for now:
# pytest.param('a', 'uvw, bar,', None, None, 'should be in aspell'),
@@ -152,12 +156,14 @@
('abcdef', 'uvwxyz, bar,', True, True, 'should be in aspell'),
('abcdef', 'uvwxyz, bar,', False, True, 'should be in aspell'),
('a', 'bar, back,', None, False, 'should not be in aspell'),
+ ('a', 'bar, back, Wednesday,', None, False, 'should not be in aspell'),
('abcdef', 'ghijkl, uvwxyz,', True, False, 'should be in aspell'),
('abcdef', 'uvwxyz, bar,', False, False, 'should not be in aspell'),
# Multi-word corrections
# One multi-word, both parts
('a', 'abcdef uvwxyz', None, True, 'should be in aspell'),
('a', 'bar back', None, False, 'should not be in aspell'),
+ ('a', 'bar back Wednesday', None, False, 'should not be in aspell'),
# Second multi-word, both parts
('a', 'bar back, abcdef uvwxyz, bar,', None, True, 'should be in aspell'),
('a', 'abcdef uvwxyz, bar back, ghijkl,', None, False, 'should not be in aspell'), # noqa: E501
diff --git a/setup.py b/setup.py
index a475ef1..b809636 100755
--- a/setup.py
+++ b/setup.py
@@ -56,5 +56,10 @@
'console_scripts': [
'codespell = codespell_lib:_script_main'
],
+ },
+ extras_require={
+ "dev": ["check-manifest", "flake8", "pytest", "pytest-cov",
+ "pytest-dependency"],
+ "hard-encoding-detection": ["chardet"],
}
)