Commit 902ee6e 1 parent fa504b1 commit 902ee6e Copy full SHA for 902ee6e
File tree 1 file changed +21
-0
lines changed
lintrunner_adapters/adapters
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 3
3
import argparse
4
4
import logging
5
5
import re
6
+ import subprocess
6
7
import sys
7
8
from typing import Pattern
8
9
@@ -109,11 +110,13 @@ def check_files(
109
110
sys .executable ,
110
111
"-mpylint" ,
111
112
"--score=n" ,
113
+ "--exit-zero" ,
112
114
* ([f"--rcfile={ rcfile } " ] if rcfile else []),
113
115
f"--jobs={ jobs } " ,
114
116
* filenames ,
115
117
],
116
118
retries = retries ,
119
+ check = True ,
117
120
)
118
121
except OSError as err :
119
122
return [
@@ -129,6 +132,24 @@ def check_files(
129
132
description = (f"Failed due to { err .__class__ .__name__ } :\n { err } " ),
130
133
)
131
134
]
135
+ except subprocess .CalledProcessError as err :
136
+ return [
137
+ LintMessage (
138
+ path = None ,
139
+ line = None ,
140
+ char = None ,
141
+ code = LINTER_CODE ,
142
+ severity = LintSeverity .ERROR ,
143
+ name = "command-failed" ,
144
+ original = None ,
145
+ replacement = None ,
146
+ description = (
147
+ f"Linter exited with return code { err .returncode } .\n "
148
+ f"STDOUT: { err .output .decode ('utf-8' )} \n \n "
149
+ f"STDERR: { err .stderr .decode ('utf-8' )} "
150
+ ),
151
+ )
152
+ ]
132
153
stdout = str (proc .stdout , "utf-8" ).strip ()
133
154
return [
134
155
LintMessage (
You can’t perform that action at this time.
0 commit comments