File tree Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ inputs:
38
38
description : ' Use library code to infer types when stubs are missing.'
39
39
required : false
40
40
default : ' false'
41
+ verify-types :
42
+ description : ' Package name to run the type verifier on; must be an *installed* library. Any score under 100% will fail the build.'
43
+ required : false
41
44
extra-args :
42
45
description : ' Extra arguments; can be used to specify specific files to check.'
43
46
required : false
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ inputs:
35
35
description : ' Use exit code of 1 if warnings are reported.'
36
36
required : false
37
37
default : ' false'
38
+ verify-types :
39
+ description : description: 'Package name to run the type verifier on; must be an *installed* library. Any score under 100% will fail the build.'
40
+ required : false
38
41
extra-args :
39
42
description : ' Extra arguments; can be used to specify specific files to check.'
40
43
required : false
Original file line number Diff line number Diff line change @@ -6198,7 +6198,7 @@ async function main() {
6198
6198
console . log ( `pyright ${ version } , node ${ process . version } ` ) ;
6199
6199
const { args, noComments } = await getArgs ( version ) ;
6200
6200
console . log ( `${ process . execPath } ${ args . join ( " " ) } ` ) ;
6201
- if ( noComments ) {
6201
+ if ( noComments || args . indexOf ( "--verifytypes" ) >= 0 ) {
6202
6202
const { status : status2 } = cp . spawnSync ( process . execPath , args , {
6203
6203
stdio : [ "ignore" , "inherit" , "inherit" ]
6204
6204
} ) ;
@@ -6291,6 +6291,11 @@ async function getArgs(version) {
6291
6291
if ( warnings ) {
6292
6292
args . push ( "--warnings" ) ;
6293
6293
}
6294
+ const verifyTypes = core . getInput ( "verify-types" ) ;
6295
+ if ( project ) {
6296
+ args . push ( "--verifytypes" ) ;
6297
+ args . push ( verifyTypes ) ;
6298
+ }
6294
6299
const extraArgs = core . getInput ( "extra-args" ) ;
6295
6300
if ( extraArgs ) {
6296
6301
args . push ( ...( 0 , import_string_argv . default ) ( extraArgs ) ) ;
Original file line number Diff line number Diff line change @@ -22,8 +22,13 @@ export async function main() {
22
22
const { args, noComments } = await getArgs ( version ) ;
23
23
console . log ( `${ process . execPath } ${ args . join ( ' ' ) } ` ) ;
24
24
25
- if ( noComments ) {
26
- // Comments are disabled, just run as a subprocess passing things through.
25
+ if ( noComments || args . indexOf ( '--verifytypes' ) >= 0 ) {
26
+ // If comments are disabled, there's no point in directly processing the output,
27
+ // as it's only used for comments.
28
+ // If we're running the type verifier, there's no guarantee that we can even act
29
+ // on the output besides the exit code.
30
+ //
31
+ // So, in either case, just directly run pyright and exit with its status.
27
32
const { status } = cp . spawnSync ( process . execPath , args , {
28
33
stdio : [ 'ignore' , 'inherit' , 'inherit' ] ,
29
34
} ) ;
@@ -150,6 +155,12 @@ async function getArgs(version: SemVer) {
150
155
args . push ( '--warnings' ) ;
151
156
}
152
157
158
+ const verifyTypes = core . getInput ( 'verify-types' ) ;
159
+ if ( project ) {
160
+ args . push ( '--verifytypes' ) ;
161
+ args . push ( verifyTypes ) ;
162
+ }
163
+
153
164
const extraArgs = core . getInput ( 'extra-args' ) ;
154
165
if ( extraArgs ) {
155
166
args . push ( ...stringArgv ( extraArgs ) ) ;
You can’t perform that action at this time.
0 commit comments