File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
.github/workflows/scripts Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
import argparse
2
2
import sys
3
3
4
- def check_ts_ignore (files ) :
4
+ def check_ts_ignore (files : list [ str ]) -> int :
5
5
"""
6
6
Checks for occurrences of '@ts-ignore' in the given files.
7
7
@@ -15,14 +15,14 @@ def check_ts_ignore(files):
15
15
16
16
for file in files :
17
17
try :
18
- with open (file , "r" , encoding = "utf-8" ) as f :
18
+ with open (file , encoding = "utf-8" ) as f :
19
19
for line_num , line in enumerate (f , start = 1 ):
20
20
if "@ts-ignore" in line :
21
21
print (f"❌ Error: '@ts-ignore' found in { file } at line { line_num } " )
22
22
ts_ignore_found = True
23
23
except FileNotFoundError :
24
24
print (f"⚠️ Warning: File not found: { file } " )
25
- except Exception as e :
25
+ except ( IOError , OSError ) as e :
26
26
print (f"⚠️ Warning: Could not read { file } : { e } " )
27
27
28
28
return 1 if ts_ignore_found else 0
You can’t perform that action at this time.
0 commit comments