62 Commits

Author SHA1 Message Date
5a5e7448a2 codespell 1.0.3 v1.0.3 2011-06-18 12:44:02 -03:00
d8467927f5 Merge branch 'dict' into v1.0.x 2011-06-18 12:42:01 -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
bb518cc274 dict: add whenver->whenever 2011-06-18 11:54:19 -03:00
097aadda85 dict: add nescessary->necessary 2011-06-11 10:04:25 -03:00
20d61df16d Merge branch 'dict' into v1.0.x 2011-05-29 01:09:12 -03:00
6c0473702c dict: remove miniscule entry 2011-05-29 01:04:38 -03:00
fc4a062f48 codespell 1.0.2 v1.0.2 2011-05-28 11:53:22 -03:00
79d2f86712 Merge branch 'dict' into v1.0.x 2011-05-28 11:51:36 -03:00
a0b54474b3 dict: disable wanna->want to automatic fix 2011-05-28 11:48:06 -03:00
95bbf25c34 Disable cmo->com entry in dictionary 2011-05-25 11:29:35 -03:00
f118ddbc40 Disable cmo->com entry in dictionary 2011-05-25 11:29:24 -03:00
7b8b6322b1 Merge branch 'dict' into v1.0.x 2011-05-22 11:02:31 -03:00
be424aca7e Add reqest->request to dictionary
Reported-by: Jim Cromie <jim.cromie@gmail.com>
2011-05-22 11:01:24 -03:00
35dc34f937 codespell 1.0.1 v1.0.1 2011-04-16 11:15:42 -03:00
558cb02e80 Merge branch 'dict' into v1.0.x 2011-04-14 15:08:28 -03:00
f78d19d76b Adding interger -> integer. 2011-04-14 15:07:42 -03:00
46754fdacd Merge branch 'dict' into v1.0.x 2011-04-14 13:56:56 -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
ae8b2a974a add "immediatelly->immediately" 2011-04-01 15:52:09 -03:00
200ba50a03 dict: add dstination misspelling 2011-03-29 23:20:16 -03:00
3a0c196609 codespell 1.0 v1.0 2011-03-29 17:42:39 -03:00
0ab5999e6f Add some misspellings v1.0-rc3 2011-03-22 17:41:52 -03:00
990a73f9f0 Add license
codespell is licensed as GPLv2
2011-03-22 17:41:02 -03:00
09b4baa68b codespell 1.0-rc2 v1.0-rc2 2011-02-21 23:59:00 -03:00
61d982adfc dictionary: add missing comma 2011-02-17 08:54:01 -02: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 v1.0-rc1 2011-02-03 01:32:02 -02:00
3e1083246b codespell itself 2011-02-03 01:13:58 -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 v0.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
a903201306 Add README file 2011-01-29 19:41:51 -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
049da20953 Use comma at the end of suggestions
Dictionary format is:

wrong_word -> suggestion1, suggestion2,[ reason ]

If there's no reason, let it blank
2011-01-29 10:21:32 -02:00
cc01ea5675 Use similar colors when using stdin 2011-01-29 10:05:26 -02:00