38 Commits

Author SHA1 Message Date
5a5e7448a2 codespell 1.0.3 2011-06-18 12:44:02 -03:00
7efceadceb Fix replacement of same word in one line
When one line had the same mispelled word, codespell was incorrectly
fixing that line, even introducing new typos. This was because the list
of misspelled words were not updated according the fixes.

Instead of always updating this list and making the loop more difficult,
we do as following:

- Cache the words that are fixed in a certain line
- Fix all cases of a misspelled in each line (this means that
  interactive mode will fix all cases with the same suggestions... not
  awesome, but simplifies a lot the code)
- Use a regex with re.sub() instead of the naive string.replace()
  function. This eliminates dumb cases of matching partial words and
  modifying them. Eg.: addres->address would modify addressable to
  addresssable.
- Skip words that were already fixed by previous iteration.

Thanks to Bruce Cran <bruce@cran.org.uk> for reporting this issue.
2011-06-18 12:40:20 -03:00
fc4a062f48 codespell 1.0.2 2011-05-28 11:53:22 -03:00
35dc34f937 codespell 1.0.1 2011-04-16 11:15:42 -03:00
7a724ef9b1 Do not override previous fix
If there are two words misspelled in a line, codespell was detecting
both, but when writing them to file only the latest was actually being
fixed. This is because we used the wrong line string to fix them.
2011-04-14 13:56:37 -03:00
3a0c196609 codespell 1.0 2011-03-29 17:42:39 -03:00
990a73f9f0 Add license
codespell is licensed as GPLv2
2011-03-22 17:41:02 -03:00
09b4baa68b codespell 1.0-rc2 2011-02-21 23:59:00 -03:00
1002cedf3f Print right lower/upper/capitalized word 2011-02-17 08:52:18 -02:00
5a1c2ad67c replace one word at a time
Since we already iterate over all words, there's no need to substitute
all the words at once.
2011-02-16 15:01:42 -02:00
1fcef67f6f codespell 1.0-rc1 2011-02-03 01:32:02 -02:00
12ca129d9b Fix 'reason' not appearing 2011-02-03 01:12:57 -02:00
e46c8a7244 Use WARNING prefix when file is binary 2011-02-03 01:05:08 -02:00
2588f4aba7 Try iso-8859-1 encoding if utf-8 fails 2011-02-03 01:05:08 -02:00
1073b60660 fix condition for closing file 2011-02-03 00:20:12 -02:00
160d3d3649 Do not open links 2011-02-02 21:21:58 -02:00
12953207d9 Fix wrong multiple replaces 2011-02-01 12:17:56 -02:00
db775bb386 codespell 0.9 2011-02-01 00:17:23 -02:00
20e27616ac Add copyright 2011-02-01 00:16:53 -02:00
7d75296376 Add version support 2011-02-01 00:16:06 -02:00
9c236af20b Write changes to file 2011-01-31 16:19:03 -02:00
b14f8e2acd Read all file into memory 2011-01-31 14:46:09 -02:00
23109a5118 Prune search on hidden directories 2011-01-31 11:31:28 -02:00
29ff5974eb Add function to detect hidden file 2011-01-31 11:31:11 -02:00
b839d7e7a5 Ignore binary files and warn on encoding error 2011-01-31 11:01:35 -02:00
a7a13118a5 Correctly detect hidden files/dirs 2011-01-31 09:53:46 -02:00
bcecc37e64 Print reason
Example:
$ ./codespell.py -d example/dict.txt example/code.c

example/code.c:9: clas  ==> class  | disabled due to name clash in c++
example/code.c:10: tis  ==> this
example/code.c:14: opem  ==> open
example/code.c:16: buring  ==> burying, burning, burin, during
example/code.c:17: clas  ==> class  | disabled due to name clash in c++
2011-01-29 11:03:24 -02:00
b11405edf7 Remove reason from suggested fixes
If there's a reason why a change is not a 1:1, do not print it in the
list of suggestions.
2011-01-29 10:58:17 -02:00
cc01ea5675 Use similar colors when using stdin 2011-01-29 10:05:26 -02:00
acba842ee5 Accept code in stdin 2011-01-29 10:03:38 -02:00
febf438c3f Do not accept dict from stdin
When checking patches instead of files, it's better to have the patch in
stdin and dict always as a file. Checking stdin instead of a file will
be added later.
2011-01-29 09:37:41 -02:00
efee004ca6 Don't disable colors when not tty
Otherwise './codespell dict file | less -R' will be always withou
colors, not really what we want.
2011-01-29 09:31:55 -02:00
c72a29d0d6 Don't care about upper or lower case in args 2011-01-29 09:30:22 -02:00
7c6d07f2d0 Add option to parse recursively 2011-01-28 23:37:24 -02:00
1487a0ab4d add option to disable colors 2011-01-28 23:02:46 -02:00
97a4c8822d remove unnecessary long phrase 2011-01-28 22:59:40 -02:00
3f31be0255 codespell itself 2011-01-28 15:22:40 -02:00
95f7c2654e Import initial version 2011-01-28 15:20:16 -02:00