56 Commits

Author SHA1 Message Date
60f61d249f Expect rare words to be in the extended dictionary 2020-04-19 18:58:23 +01:00
d978da6e31 Check errors don't exist as valid words in the aspell dictionary (#1142)
* Check errors don't exist as valid words in the aspell dictionary

* Install aspell on Travis

* Add some missing packages

* Remove a virtual package

* Just install the version of aspell-python we need

* Keep flake8 happy

* Switch to warnings and count them, so we can see all the aspell errors in one go

* Handle different encoding of the word and aspell

* Try and fix the encoding conversion

* Find out the encoding type

* Don't assert on number of warnings

* Don't record warnings for now

* Warn on all the encoding options

* pprint the encoding

* More warning work

* Use the actual encoding type

* Correct the logic

* ENH: Multi dict support

* FIX: Fixes after merge

* FIX: Better error check

* FIX: More thorough testing, locations

* FIX: Try newer aspell

* FIX: Move to new dict

* FIX: Move

* FIX: Restore removals from #1181

* FIX: One from #1362

* Add rare chack->check, cheque,

* Minor tidy of some dictionary check code

* Add some more suggestions.

* Fix the whitespace

* Really fix the whitespace

* FIX: Refactor requirement

* Log an error when aspell not found and not required

* Fix the error logging

* Test all variants of present and missing from aspell

* Undo some tuple tidying

* Fix the true/false values used

* Skip some flake8 tests

* Fix the test cases

* Correct the not in aspell test and fix some test cases

* Remove a duplicate test

* Use a test word that isn't a typo

* Set the ideal aspell detection logic for each dictionary

I suspect we'll have to relax this as more obscure words won't be in the aspell dictionary

* Be more realistic given the size of the dictionary

* Fix a flake8 error

* Fix another line length error

* FIX: Move

* FIX: Make visible, simplify

Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
2020-04-06 12:54:16 -04:00
33647e28b7 Travis CI: Add Python 3.8 to the testing (#1401)
* Travis CI: Add Python 3.8 to the testing

Py38 generates RuntimeWarnings...

$ __codespell__
```
/home/travis/virtualenv/python3.8.0/lib/python3.8/codecs.py:905:
RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode,
    the default buffer size will be used
file = builtins.open(filename, mode, buffering)
```

* Fix Python >= 3.8 RuntimeWarning for file buffering

* placate flake8

* Use a backslash despite PEP8 to placate flake8

* FIX: Warnings

Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
2020-01-15 11:00:57 -05:00
233d76c21b Allow to use --skip multiple times (#1351)
Make it possible to add custom system-wide ignored directories with an
alias in shell rc script, e.g.:

    alias codespell="codespell --skip=".git,node_modules"

and allow to extend this list by executing codespell alias with extra
--skip argument.
2019-12-01 07:20:17 -05:00
d7fa1e4508 MAINT: Bump version 2019-09-12 11:47:36 -04:00
89b826dba7 FIX: Bump version 2019-09-12 11:45:01 -04:00
6e71e03db2 Change from optparse to argparse (#1218) 2019-08-29 09:55:40 -04:00
f614cfb900 FIX: Bump version (#1121)
* FIX: Bump version

* FIX: Docutils
2019-05-17 14:18:21 -04:00
4029f22485 FIX: Bump version 2019-05-17 14:06:01 -04:00
e74f433bb8 Add context options: -A/-B/-C; Fixes #287 (#722)
* Add context options: -A/-B/-C; Fixes #287

* Fix indentation of line continuation.

* Fix 'only before context' case.

* Add some tests for the new context options.

* Refactor context code (pass context tuple, instead of before/after variables)

* Get rid of 'remove temp file code' in context test.

* Fix reintroduced error (regarding 'only before context').
2018-10-30 13:49:05 -04:00
ebc9b08fde Use proper escaping in 'word_regex_def'. (#724) 2018-10-24 12:04:28 -04:00
d1a3a89762 FIX: Bump version 2018-10-03 11:51:27 -04:00
2eef8266a3 FIX: Bump version 2018-10-03 11:50:20 -04:00
8b0960e63b ENH: Avoid globals, simpler testing (#648)
* ENH: Avoid globals, simpler testing

* FIX: Reorder
2018-09-10 10:06:43 -04:00
4175f457f4 Add -L/--ignore-words-list to whitelist words directly without using an 'ignore file'. (#650) 2018-09-09 15:24:13 -04:00
93a817c776 Allow hidden files to optionally be checked (#603)
* Add a test for skipping globs with directory and filename in

* Forcing a Travis build

* Tidy the Travis force

* Skip paths with the glob mathing too

* Add a check for new hidden file functionality

* Fix the code to add the new options

* Fix the test syntax

* Fix the flake8 error

* Improve help text
2018-07-30 12:19:04 -04:00
57c3b26765 Extend --skip to match globs across full paths. Closes #283 (#600)
* Add a test for skipping globs with directory and filename in

* Forcing a Travis build

* Tidy the Travis force

* Skip paths with the glob mathing too
2018-07-29 16:34:21 -04:00
f9f8d1fcca Add missing space in help (#534) 2018-06-04 09:18:16 -04:00
a53944917f FIX: Bump version to 0.14.0.dev0 2018-05-17 11:52:01 -04:00
b86ae67243 FIX: Bump version 2018-05-17 11:50:40 -04:00
50bcf82833 FIX: Caps and pytest (#482)
* FIX: Caps and pytest

* FIX: Check in code

* FIX: Check for unique names

* FIX: Minor fixes

* FIX: More checks
2018-05-07 13:27:48 -04:00
d44420c291 Add the Unicode apostrophe as a word separator (#418)
* Add the Unicode apostrophe as a word separator

* Also add `

* try ur"" instead u""

* And remove the 'r'
2018-04-24 10:44:46 -04:00
203c43ff44 Drop path in help output to make the build reproducible (#420)
Closes #419
2018-03-29 11:06:41 -04:00
57e268336e FIX: Bump version 2018-03-09 12:03:28 -05:00
00cc2174d2 FIX: Bump version 2018-03-09 12:01:58 -05:00
493535cf8c Improve grammar in description of "-i" (#384) 2018-03-06 09:23:40 -05:00
6a3723a0e3 FIX: Bump version 2017-11-27 09:43:21 -05:00
a2d53ef09e FIX: Bump version 2017-11-27 09:40:03 -05:00
e2127ba6bc FIX: Fix test 2017-11-15 13:09:58 -05:00
70b96d4567 FIX: Fix for Windows 2017-11-15 11:42:52 -05:00
3f0dc50ce5 FIX: Wrap properly 2017-11-15 11:42:52 -05:00
c0315245bf Merge pull request #144 from thdot/check-filenames
Add new --check-filenames option to check file names as well
2017-10-09 11:12:00 -04:00
b78dcae830 Further elaborate on codespell -I in --help output
Also includes a format refinement to README.rst
2017-10-09 11:05:38 -04:00
c7ffd4e50c Add new --check-filenames option to check file names as well
A new command line option -f / --check-filenames is implemented which
enables the check of the given file names.
2017-10-05 21:21:46 +02:00
66cc33c230 Skip relative directories
The current code already allows skipping directories, but the full path
must be given, e.g. "./.git" instead of just ".git", as "codespell ." is
the default.

Allow --skip to be used with relative directory names, too.
2017-08-17 17:26:00 +02:00
32781f9c31 Check filename early
The check works on the relative file name, so move the check before
calling join() to build the complete path name.
2017-08-17 16:21:04 +02:00
b91f7c76b4 Skip directories early
The current code already allows skipping directories, but the full path
must be given, e.g. "./.git" instead of just ".git", as "codespell ." is
the default.

As the name of the directory is constant for all files within, move the
check for the directory before the loop.

Also skip descending.
2017-08-17 16:20:48 +02:00
3bb1f6a050 Add new --ignore-words option to ignore 'good' words
A new command line option -I / --ignore-words is implemented to specify
one or multiple files containing 'good' words which codespell will
ignore.
2017-03-21 21:50:03 -07:00
22a4afe304 FIX: Bump version 2017-03-15 10:10:41 -04:00
f8780fa092 FIX: Fix version 2017-03-15 10:08:11 -04:00
66c527b3d1 Add new --regex option to set regular expression used to find words
A new command line option -r / --regex is implemented to allow the user
to set the regular expression which is used to find the words in the
input lines. This is useful in projects where you want to overwrite the
default expression, for example to split words after an underscore like
in ID_ESTABLISED.
The new regex option cannot be used together with the --write-changes
functionality since it is not guarantied that this will not break code.
2017-03-07 07:54:35 -08:00
f75e2e9e64 Fix travis-ci build error 2017-01-04 21:23:24 +01:00
ff5e858aa5 Change the line numbering in display to 1-based 2017-01-04 12:06:20 -08:00
040e1109d3 Compile regular expression only once
The regular expression for splitting a line into words can be compiled
at startup instead for every file again. This gives some minor
performance improvements, especially when parsing a lot of files.
2016-11-12 23:57:44 -08:00
171568f13d Enhance --dictionary option to allow multiple dictionaries
Enhance the --dictionary option so that multiple dictionary files can
be specified at the command line. With this feature projects can use 
the standard dictionary and in addition their own custom files.
2016-11-12 23:57:44 -08:00
2737d6f2bd Fix off-by-one error 2016-08-31 15:43:34 +09:00
94ddc3369b FIX: Back to dev 2016-06-17 16:57:11 -04:00
4dbb0e5f5d FIX: Version for bugfix release 2016-06-17 16:55:43 -04:00
626a180188 FIX: Fix version 2016-06-16 13:22:24 -04:00
a9f2ed43f6 FIX: Fix packaging 2016-06-16 13:18:57 -04:00