@@ -467,7 +467,11 @@ def pyright_format_sarif(results: dict, target: Path) -> dict:
467467
468468def pyright_linter (target : Path , typeshed_path : Path ) -> Optional [dict ]:
469469 """Run the pyright linter."""
470- process = run (["pyright" , "--outputjson" , "--typeshedpath" , typeshed_path , target .absolute ().as_posix ()], capture_output = True , check = False )
470+ process = run (
471+ ["pyright" , "--outputjson" , "--typeshedpath" , typeshed_path , target .absolute ().as_posix ()],
472+ capture_output = True ,
473+ check = False ,
474+ )
471475
472476 if process .stderr :
473477 LOG .error ("STDERR: %s" , process .stderr .decode ("utf-8" ))
@@ -553,7 +557,9 @@ def pytype_linter(target: Path, typeshed_path: Path) -> Optional[dict]:
553557 os .environ ["TYPESHED_HOME" ] = typeshed_path .as_posix ()
554558
555559 process = run (
556- ["pytype" , "--exclude" , ".pytype/" , "--" , target .as_posix ()], capture_output = True , check = False ,
560+ ["pytype" , "--exclude" , ".pytype/" , "--" , target .as_posix ()],
561+ capture_output = True ,
562+ check = False ,
557563 )
558564
559565 if process .stderr :
@@ -575,7 +581,18 @@ def pytype_linter(target: Path, typeshed_path: Path) -> Optional[dict]:
575581def pyre_linter (target : Path , typeshed_path : Path ) -> Optional [dict ]:
576582 """Run the pytype linter."""
577583 process = run (
578- ["pyre" , "--source-directory" , target .as_posix (), "--output" , "sarif" , "--typeshed" , typeshed_path .as_posix (), "check" ], capture_output = True , check = False
584+ [
585+ "pyre" ,
586+ "--source-directory" ,
587+ target .as_posix (),
588+ "--output" ,
589+ "sarif" ,
590+ "--typeshed" ,
591+ typeshed_path .as_posix (),
592+ "check" ,
593+ ],
594+ capture_output = True ,
595+ check = False ,
579596 )
580597
581598 if process .stderr :
@@ -715,7 +732,7 @@ def add_args(parser: ArgumentParser) -> None:
715732 parser .add_argument ("linter" , choices = LINTERS .keys (), nargs = "+" , help = "The linter(s) to use" )
716733 parser .add_argument ("--target" , "-t" , default = "." , required = False , help = "Target path for the linter" )
717734 parser .add_argument ("--output" , "-o" , default = "python_linter.sarif" , required = False , help = "Output filename" )
718- parser .add_argument ("--typeshed-path" ,required = False , help = "Path to typeshed" )
735+ parser .add_argument ("--typeshed-path" , required = False , help = "Path to typeshed" )
719736 parser .add_argument ("--debug" , "-d" , action = "store_true" , required = False , help = "Enable debug logging" )
720737
721738
0 commit comments