40 Commits

Author SHA1 Message Date
909f0dce08 More tests 2020-10-12 14:15:38 -07:00
f315b0dec6 Tests and option 2020-09-08 10:42:39 -07:00
8069358084 Remove duplicate test 2020-08-28 14:32:10 -07:00
b8db3f0883 Fix flake8 2020-08-28 14:29:59 -07:00
1e7f5f7e6f Add support for ignoring spelling mistakes in URIs specifically. 2020-08-28 14:23:10 -07:00
5ae1b91fae More tests 2020-08-10 15:21:56 -07:00
5c608e018d Add tests for empty ignore-regex 2020-08-06 11:36:22 -07:00
69ece679a5 Remove accidental argparse import 2020-07-27 11:29:26 -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
3508ed6b5f More --ignore-regex tests 2020-07-10 15:09:27 -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
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
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
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
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
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
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
e3c965220e ENH: Check for whitespace (#616) 2018-08-12 13:43:22 -06: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
8a590bdeec ENH: Add test 2018-07-16 09:49:34 -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
c33983549a FIX: More newline 2017-11-15 13:27:01 -05:00
23f2ef5cc6 FIX: Fix endings 2017-11-15 13:23:59 -05:00
cc2dc05cc1 Revert 2017-11-15 13:15:56 -05:00
e2127ba6bc FIX: Fix test 2017-11-15 13:09:58 -05:00
e1cc76ac07 FIX: Fixes for Windows 2017-11-15 12:27:35 -05: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
bdc95edd79 added unit-tests for new --ignore-words and --regex option 2017-03-21 21:50:03 -07:00
fb6f01db96 Move bin/codespell.py to bin/codespell
From discussion in GH#85, the executable was renamed to
codespell to preserve backward compatibility with how
the Makefile used to install the library.
2016-08-18 11:49:43 -04:00
e9d8629cd9 FIX: Fix command 2016-06-17 16:07:11 -04:00
0d91bf2cd6 ENH: Increase coverage 2016-04-27 12:21:57 -04:00
b266720d26 ENH: Skip directories 2016-04-27 10:38:34 -04:00
b400e4250d ENH: Restructure for Travis 2016-04-27 10:18:36 -04:00