84 Commits

Author SHA1 Message Date
481b6080d3 Test: Reintroduce language parameter 2020-10-03 10:22:46 +02:00
60b905dba0 Test: Change en_GB to en_GB-ise 2020-09-24 12:05:51 +02:00
eedad8a445 Test: Add CA and AU again 2020-09-24 11:54:55 +02:00
86e61e0b00 Test: delete enAU and enCA 2020-09-24 11:54:53 +02:00
a2296085bc Tests: Allow in_aspell to be list of dictionaries 2020-09-24 11:54:53 +02:00
9672234591 Read options from config (#1668)
* Read options from config

* Fix assert in test

* Fix tests

* Fix readme to pass rst checks in Travis

* Also support .codespellrc config file

* Fix flake8 error

* CLI args override config args

* Rename tool:codespell to just codespell in config

* Fix typo in readme

* Remove unnecessary check for existance of config files (configparser already handles this case)
2020-09-01 15:10:19 -04:00
5ae1b91fae More tests 2020-08-10 15:21:56 -07:00
da4ae3e54c Addressing comments 2020-07-27 11:26:15 -07:00
9d6f0051b2 Switch to ignore-regex as a simple flag 2020-07-24 12:41:17 -07:00
018f0c6465 Add --ignore-regex for URI/email handling.
This is for issue #676, where typos are found in actually-okay URIs/emails. Because these are closer to names in context, this ignores them.

Mechanically, this erases the URI/email text before the word regex is applied.
2020-07-08 09:19:27 -07:00
00f8ffd23d BUG: Use return codes properly, add --count (#1558)
* BUG: Use return codes properly, add --count

* FIX: EX_USAGE (kind of)

* FIX: EX_USAGE (really)

* FIX: Dont bother importing

* FIX: More

* STY: Caps

* MAINT: Version bump
2020-06-16 12:03:47 -04:00
2657d752e6 ENH: Multiline help (#1559)
* ENH: Multiline help

* STY: Use %(default)r

* DOC: Document rationale
2020-06-12 19:24:39 -04:00
a24debaf46 Disable 'BINARY file' warning by default (#1441)
* Disable 'BINARY file' warning by default

Currently codespell prints a warning if it finds binary files in the tree.
This is annoying as many projects contain .git/.svn blobs, images, etc.
Disable the warning by default and let users enable it if needed.

Co-authored-by: Waldir Pimenta <waldyrious@gmail.com>

* Improve help message for the --quiet-level option

* Update _codespell.py

Co-authored-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
2020-06-11 16:42:49 -04:00
5ed84fce8c Add renaming advice based on IETF draft-knodel-terminology-00 (#1556)
* Add renaming advice based on IETF draft-knodel-terminology-00

Add a new "usage" dictionary with usage advice based on:
https://tools.ietf.org/id/draft-knodel-terminology-00.html#rfc.section.1.1.1

Offer to replace master/slave with:
- Primary-secondary
- Leader-follower
- Active-standby
- Primary-replica
- Writer-reader
- Coordinator-worker
- Parent-helper

* Move recommended terms to "usage" dictionary

Backout the changes from commit 98ab0fa and move them into the
"usage" dictionary.

* Fix use of "whitelist" in README

Use the recommended replacement "allowlist"

* Update codespell_lib/_codespell.py

Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
2020-06-11 11:53:57 -04:00
f24af24a01 FIX: Misspelled dir 2020-06-10 10:54:05 -04:00
f566b4fe2e FIX: --check-hidden respects directories 2020-06-10 10:11:40 -04:00
73dd9755c4 Update _codespell.py 2020-06-06 02:02:29 +01:00
f107ddb54b Fix the filename typo detection edge cases. Closes #1532 and some other bugs (#1539)
* Add a test for checking the filename of an empty file

To test #1532

* Test an irregular file with a typo

* Fix the filename typo detection edge cases

* Split the irregular file test into a seperate test

Probably easier to skip and certainly makes the maths easier

* Skip the test if mkfifo is missing

* Add the missing import

* Fix the test skip logic

* Write in the right language!

* Test filename checking on a binary file
2020-06-03 12:54:31 -04:00
c2fe4165b1 Correctly ignore hidden files in directories. Closes #1531 (#1533)
* Add some tests for #1531

* Ignore hidden files in directories, fixes #1531
2020-06-01 10:38:06 -04:00
3ed982c4b1 Fix the random whitespace after the binary file error (#1525)
Also be more consistent about single or double quoting strings and make the error messages more consistent to help with the problem matcher
2020-05-26 10:08:28 -04:00
dfb8f10816 MAINT: Bump to 1.18.dev0 2020-05-22 09:32:14 -04:00
52bcd9d5fb MAINT: Revert to 1.17.1 for release (#1519) 2020-05-22 09:31:13 -04:00
6354481fa0 Fix a careless merge 2020-05-22 08:40:56 +01:00
63f5940e75 Merge branch 'master' into bump 2020-05-22 08:40:15 +01:00
797e347c93 FIX: 1.17.1 2020-05-21 23:09:19 -04:00
376b9c45b5 MAINT: Bump to 1.18.dev0 2020-05-21 14:04:16 -04:00
9e44263300 FIX: Tick version 2020-05-20 15:26:38 -04:00
a1adc8168e Remove an extra space
Also make some quoting a little more consistent
2020-05-16 14:54:27 +01:00
f27fb996f9 Fix the new flake8 errors (#1505)
* Fix the new flake8 errors

* Fix the line length 🤦
2020-05-12 21:55:23 -04: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