File tree 3 files changed +15
-0
lines changed
3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 144
144
# target when running tests, otherwise this can be omitted.
145
145
#nodejs = "node"
146
146
147
+ # The eslint executable to use. Note that this is only used for linting js files
148
+ # during the test phase. It can be omitted.
149
+ #eslint = "eslint"
150
+
147
151
# Python interpreter to use for various tasks throughout the build, notably
148
152
# rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
149
153
# Note that Python 2 is currently required.
Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ pub struct Config {
136
136
pub libdir : Option < PathBuf > ,
137
137
pub mandir : Option < PathBuf > ,
138
138
pub codegen_tests : bool ,
139
+ pub eslint : Option < PathBuf > ,
139
140
pub nodejs : Option < PathBuf > ,
140
141
pub gdb : Option < PathBuf > ,
141
142
pub python : Option < PathBuf > ,
@@ -202,6 +203,7 @@ struct Build {
202
203
gdb : Option < String > ,
203
204
locked_deps : Option < bool > ,
204
205
vendor : Option < bool > ,
206
+ eslint : Option < String > ,
205
207
nodejs : Option < String > ,
206
208
python : Option < String > ,
207
209
full_bootstrap : Option < bool > ,
@@ -444,6 +446,7 @@ impl Config {
444
446
} ;
445
447
446
448
449
+ config. eslint = build. eslint . map ( PathBuf :: from) ;
447
450
config. nodejs = build. nodejs . map ( PathBuf :: from) ;
448
451
config. gdb = build. gdb . map ( PathBuf :: from) ;
449
452
config. python = build. python . map ( PathBuf :: from) ;
Original file line number Diff line number Diff line change @@ -609,6 +609,14 @@ impl Step for RustdocJS {
609
609
"No nodejs found, skipping \" src/test/rustdoc-js\" tests"
610
610
) ;
611
611
}
612
+
613
+ if let Some ( ref eslint) = builder. config . eslint {
614
+ let mut command = Command :: new ( eslint) ;
615
+ command. args ( & [ "src/librustdoc/html/static" ] ) ;
616
+ builder. run ( & mut command) ;
617
+ } else {
618
+ builder. info ( "No eslint found, skipping js linting" ) ;
619
+ }
612
620
}
613
621
}
614
622
You can’t perform that action at this time.
0 commit comments