@@ -499,12 +499,13 @@ class DevicetreeLintingCheck(ComplianceTest):
499499 NPX_EXECUTABLE = "npx"
500500
501501 def ensure_npx (self ) -> bool :
502- if not shutil .which (self .NPX_EXECUTABLE ):
502+ if not ( npx_executable := shutil .which (self .NPX_EXECUTABLE ) ):
503503 return False
504504 try :
505+ self .npx_exe = npx_executable
505506 # --no prevents npx from fetching from registry
506507 subprocess .run (
507- [self .NPX_EXECUTABLE , "--prefix" , "./scripts/ci" , "--no" , 'dts-linter' , "--" , "--version" ],
508+ [self .npx_exe , "--prefix" , "./scripts/ci" , "--no" , 'dts-linter' , "--" , "--version" ],
508509 stdout = subprocess .DEVNULL ,
509510 stderr = subprocess .DEVNULL ,
510511 check = True ,
@@ -535,6 +536,7 @@ def _parse_json_output(self, cmd, cwd=None):
535536 raise RuntimeError (f"Failed to parse dts-linter JSON output: { e } " )
536537
537538 def run (self ):
539+ self .npx_exe = self .NPX_EXECUTABLE
538540 # Get changed DTS files
539541 dts_files = [
540542 file for file in get_files (filter = "d" )
@@ -560,7 +562,7 @@ def run(self):
560562 temp_patch_files .append (temp_patch )
561563
562564 cmd = [
563- "npx" , "--prefix" , "./scripts/ci" , "--no" ,
565+ self . npx_exe , "--prefix" , "./scripts/ci" , "--no" ,
564566 "dts-linter" , "--" , "--outputFormat" ,
565567 "json" , "--format" ,
566568 "--patchFile" , temp_patch ,
0 commit comments