File tree 2 files changed +8
-11
lines changed
2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,8 @@ lint.ignore = [
119
119
" PT018" , # Assertion should be broken down into multiple parts
120
120
" S101" , # Use of `assert` detected -- DO NOT FIX
121
121
" S311" , # Standard pseudo-random generators are not suitable for cryptographic purposes -- FIX ME
122
- " SLF001" , # Private member accessed: `_Iterator` -- FIX ME
123
122
" SIM905" , # Consider using a list literal instead of `str.split` -- DO NOT FIX
123
+ " SLF001" , # Private member accessed: `_Iterator` -- FIX ME
124
124
" UP038" , # Use `X | Y` in `{}` call instead of `(X, Y)` -- DO NOT FIX
125
125
]
126
126
Original file line number Diff line number Diff line change 9
9
filepaths = list (good_file_paths ())
10
10
assert filepaths , "good_file_paths() failed!"
11
11
12
- upper_files = [file for file in filepaths if file != file .lower ()]
13
- if upper_files :
12
+ if upper_files := [file for file in filepaths if file != file .lower ()]:
14
13
print (f"{ len (upper_files )} files contain uppercase characters:" )
15
14
print ("\n " .join (upper_files ) + "\n " )
16
15
17
- space_files = [file for file in filepaths if " " in file ]
18
- if space_files :
16
+ if space_files := [file for file in filepaths if " " in file ]:
19
17
print (f"{ len (space_files )} files contain space characters:" )
20
18
print ("\n " .join (space_files ) + "\n " )
21
19
22
- hyphen_files = [file for file in filepaths if "-" in file ]
23
- if hyphen_files :
20
+ if hyphen_files := [
21
+ file for file in filepaths if "-" in file and "/site-packages/" not in file
22
+ ]:
24
23
print (f"{ len (hyphen_files )} files contain hyphen characters:" )
25
24
print ("\n " .join (hyphen_files ) + "\n " )
26
25
27
- nodir_files = [file for file in filepaths if os .sep not in file ]
28
- if nodir_files :
26
+ if nodir_files := [file for file in filepaths if os .sep not in file ]:
29
27
print (f"{ len (nodir_files )} files are not in a directory:" )
30
28
print ("\n " .join (nodir_files ) + "\n " )
31
29
32
- bad_files = len (upper_files + space_files + hyphen_files + nodir_files )
33
- if bad_files :
30
+ if bad_files := len (upper_files + space_files + hyphen_files + nodir_files ):
34
31
import sys
35
32
36
33
sys .exit (bad_files )
You can’t perform that action at this time.
0 commit comments