@@ -15,6 +15,7 @@ WATTSI_LATEST=90
15
15
# Shared state variables throughout this script
16
16
LOCAL_WATTSI=true
17
17
DO_UPDATE=true
18
+ DO_LINT=true
18
19
USE_DOCKER=false
19
20
VERBOSE=false
20
21
QUIET=false
@@ -71,12 +72,7 @@ function main {
71
72
HTML_GIT_DIR=" $HTML_SOURCE /.git/"
72
73
HTML_SHA=${SHA_OVERRIDE:- $(git --git-dir=" $HTML_GIT_DIR " rev-parse HEAD)}
73
74
74
- $QUIET || echo " Linting the source file..."
75
- ./lint.sh " $HTML_SOURCE /source" || {
76
- echo
77
- echo " There were lint errors. Stopping."
78
- exit 1
79
- }
75
+ doLint
80
76
81
77
clearCacheIfNecessary
82
78
@@ -135,13 +131,17 @@ function processCommandLineArgs {
135
131
echo " -d|--docker Use Docker to build in a container."
136
132
echo " -s|--serve After building, serve the results on http://localhost:$SERVE_PORT ."
137
133
echo " -n|--no-update Don't update before building; just build."
134
+ echo " -l|--no-lint Don't lint before building; just build."
138
135
echo " -q|--quiet Don't emit any messages except errors/warnings."
139
136
echo " -v|--verbose Show verbose output from every build step."
140
137
exit 0
141
138
;;
142
139
-n|--no-update|--no-updates)
143
140
DO_UPDATE=false
144
141
;;
142
+ -l|--no-lint)
143
+ DO_LINT=false
144
+ ;;
145
145
-d|--docker)
146
146
USE_DOCKER=true
147
147
;;
@@ -210,6 +210,23 @@ function ensureHighlighterInstalled {
210
210
fi
211
211
}
212
212
213
+ # Runs the lint.sh script, if requested
214
+ # - Arguments: none
215
+ # - Output:
216
+ # - Will echo any errors and exit the script with error code 1 if lint fails.
217
+ function doLint {
218
+ if [[ $DO_LINT == " false" ]]; then
219
+ return
220
+ fi
221
+
222
+ $QUIET || echo " Linting the source file..."
223
+ ./lint.sh " $HTML_SOURCE /source" || {
224
+ echo
225
+ echo " There were lint errors. Stopping."
226
+ exit 1
227
+ }
228
+ }
229
+
213
230
# Finds the location of the HTML Standard, and stores it in the HTML_SOURCE variable.
214
231
# It either guesses based on directory structure, or interactively prompts the user.
215
232
# - Arguments: none
@@ -412,6 +429,7 @@ function doDockerBuild {
412
429
$QUIET && DOCKER_RUN_ARGS+=( --quiet )
413
430
$VERBOSE && DOCKER_RUN_ARGS+=( --verbose )
414
431
$DO_UPDATE || DOCKER_RUN_ARGS+=( --no-update )
432
+ $DO_LINT || DOCKER_RUN_ARGS+=( --no-lint )
415
433
$SERVE && DOCKER_RUN_ARGS+=( --serve )
416
434
417
435
# Pass in the html-build SHA (since there's no .git directory inside the container)
0 commit comments