We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a050986 commit f79ce79Copy full SHA for f79ce79
codespell_lib/_codespell.py
@@ -920,7 +920,9 @@ def main(*args):
920
uri_ignore_words, context, options)
921
922
# skip (relative) directories
923
- dirs[:] = [dir_ for dir_ in dirs if not glob_match.match(dir_)]
+ dirs[:] = [dir_ for dir_ in dirs
924
+ if not glob_match.match(dir_)
925
+ and not is_hidden(dir_, options.check_hidden)]
926
927
elif not glob_match.match(filename): # skip files
928
bad_count += parse_file(
codespell_lib/tests/test_basic.py
@@ -391,12 +391,17 @@ def test_check_hidden(tmpdir, capsys):
391
assert cs.main(d) == 0
392
assert cs.main('--check-hidden', d) == 1
393
assert cs.main('--check-hidden', '--check-filenames', d) == 2
394
- os.mkdir(op.join(d, '.abandonned'))
+ hidden_dir = op.join(d, '.abandonned')
395
+ os.mkdir(hidden_dir)
396
copyfile(op.join(d, '.abandonned.txt'),
- op.join(d, '.abandonned', 'abandonned.txt'))
397
+ op.join(hidden_dir, 'abandonned.txt'))
398
+ hidden_subdir = op.join(hidden_dir, 'subdir')
399
+ os.mkdir(hidden_subdir)
400
+ copyfile(op.join(d, '.abandonned.txt'),
401
+ op.join(hidden_subdir, 'abandonned.txt'))
402
- assert cs.main('--check-hidden', d) == 2
- assert cs.main('--check-hidden', '--check-filenames', d) == 5
403
+ assert cs.main('--check-hidden', d) == 3
404
+ assert cs.main('--check-hidden', '--check-filenames', d) == 8
405
406
407
def test_case_handling(tmpdir, capsys):
0 commit comments