File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -1180,12 +1180,13 @@ def main(*args: str) -> int:
11801180 options .ignore_words
11811181 )
11821182 for ignore_words_file in ignore_words_files :
1183- if not os .path .isfile (ignore_words_file ):
1183+ try :
1184+ build_ignore_words (ignore_words_file , ignore_words , ignore_words_cased )
1185+ except OSError as e :
11841186 return _usage_error (
11851187 parser ,
1186- f"ERROR: cannot find ignore-words file: { ignore_words_file } " ,
1188+ f"ERROR: cannot read ignore-words- file { e . filename } : { e . strerror } " ,
11871189 )
1188- build_ignore_words (ignore_words_file , ignore_words , ignore_words_cased )
11891190
11901191 uri_regex = options .uri_regex or uri_regex_def
11911192 try :
@@ -1258,7 +1259,13 @@ def main(*args: str) -> int:
12581259 if options .exclude_file :
12591260 exclude_files = flatten_clean_comma_separated_arguments (options .exclude_file )
12601261 for exclude_file in exclude_files :
1261- build_exclude_hashes (exclude_file , exclude_lines )
1262+ try :
1263+ build_exclude_hashes (exclude_file , exclude_lines )
1264+ except OSError as e :
1265+ return _usage_error (
1266+ parser ,
1267+ f"ERROR: cannot read exclude-file { e .filename } : { e .strerror } " ,
1268+ )
12621269
12631270 file_opener = FileOpener (
12641271 options .hard_encoding_detection ,
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ ignore = [
161161]
162162
163163[tool .ruff .lint .mccabe ]
164- max-complexity = 45
164+ max-complexity = 46
165165
166166[tool .ruff .lint .per-file-ignores ]
167167"codespell_lib/_codespell.py" = [" A003" ]
@@ -171,6 +171,6 @@ max-complexity = 45
171171[tool .ruff .lint .pylint ]
172172allow-magic-value-types = [" bytes" , " int" , " str" ,]
173173max-args = 13
174- max-branches = 48
175- max-returns = 12
174+ max-branches = 49
175+ max-returns = 13
176176max-statements = 119
You can’t perform that action at this time.
0 commit comments