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:
1180
1180
options .ignore_words
1181
1181
)
1182
1182
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 :
1184
1186
return _usage_error (
1185
1187
parser ,
1186
- f"ERROR: cannot find ignore-words file: { ignore_words_file } " ,
1188
+ f"ERROR: cannot read ignore-words- file { e . filename } : { e . strerror } " ,
1187
1189
)
1188
- build_ignore_words (ignore_words_file , ignore_words , ignore_words_cased )
1189
1190
1190
1191
uri_regex = options .uri_regex or uri_regex_def
1191
1192
try :
@@ -1258,7 +1259,13 @@ def main(*args: str) -> int:
1258
1259
if options .exclude_file :
1259
1260
exclude_files = flatten_clean_comma_separated_arguments (options .exclude_file )
1260
1261
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
+ )
1262
1269
1263
1270
file_opener = FileOpener (
1264
1271
options .hard_encoding_detection ,
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ ignore = [
161
161
]
162
162
163
163
[tool .ruff .lint .mccabe ]
164
- max-complexity = 45
164
+ max-complexity = 46
165
165
166
166
[tool .ruff .lint .per-file-ignores ]
167
167
"codespell_lib/_codespell.py" = [" A003" ]
@@ -171,6 +171,6 @@ max-complexity = 45
171
171
[tool .ruff .lint .pylint ]
172
172
allow-magic-value-types = [" bytes" , " int" , " str" ,]
173
173
max-args = 13
174
- max-branches = 48
175
- max-returns = 12
174
+ max-branches = 49
175
+ max-returns = 13
176
176
max-statements = 119
You can’t perform that action at this time.
0 commit comments