@@ -86,18 +86,37 @@ def should_build(self, host_target):
86
86
def build (self , host_target ):
87
87
self .run_build_script_helper ('build' , host_target )
88
88
if self .args .swiftsyntax_lint :
89
- self .lint_swiftsyntax ()
89
+ self .lint_swiftsyntax (host_target )
90
90
if self .args .sourcekitlsp_lint :
91
91
self .lint_sourcekitlsp ()
92
92
93
- def lint_swiftsyntax (self ):
93
+ def lint_swiftsyntax (self , host_target ):
94
+ swift_exec = os .path .join (
95
+ self .install_toolchain_path (host_target ),
96
+ 'bin' ,
97
+ 'swift'
98
+ )
99
+ swift_syntax_dev_utils_dir = os .path .join (
100
+ os .path .dirname (self .source_dir ),
101
+ 'swift-syntax' ,
102
+ 'SwiftSyntaxDevUtils'
103
+ )
104
+ swift_format_exec = os .path .join (
105
+ self .build_dir ,
106
+ self .configuration (),
107
+ 'swift-format'
108
+ )
94
109
linting_cmd = [
95
- os .path .join (os .path .dirname (self .source_dir ), 'swift-syntax' , 'format.py' ),
110
+ swift_exec ,
111
+ 'run' ,
112
+ '--package-path' , swift_syntax_dev_utils_dir ,
113
+ 'swift-syntax-dev-utils' ,
114
+ 'format' ,
115
+ '--verbose' ,
96
116
'--lint' ,
97
- '--swift-format' , os .path .join (self .build_dir , self .configuration (),
98
- 'swift-format' ),
117
+ '--swift-format' , swift_format_exec
99
118
]
100
- shell .call (linting_cmd )
119
+ shell .call (linting_cmd , env = { 'SWIFTCI_USE_LOCAL_DEPS' : '1' } )
101
120
102
121
def lint_sourcekitlsp (self ):
103
122
linting_cmd = [
0 commit comments