-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
29 lines (26 loc) · 1.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# NOTE 1: these targets require the "prettier" Node.js package is globally
# installed
#
# NOTE 2: this code was derived from Qurro's Makefile
# (https://github.com/biocore/qurro/blob/master/Makefile)
#
# NOTE 3: HTML code is currently not included in these operations, since it
# seems to break prettier. (I think some of that is due to actual HTML errors,
# but some of that seems to be due to the Tornado template syntax messing
# things up.)
#
# NOTE 4: The "fe" in these targets' names comes from "front end."
.PHONY: festyle festylecheck
JS_CSS_CODE_LOCS = labcontrol/gui/static/js/*.js labcontrol/gui/static/css/labcontrol.css labcontrol/gui/js_tests/*.js
HTML_CODE_LOCS = labcontrol/gui/templates/*.html labcontrol/gui/js_tests/*.html
# This target auto-formats all of the JS and CSS code to be compliant with
# prettier.
festyle:
@# To be extra safe, do a dry run of prettier and check that it hasn't
@# changed the code's abstract syntax tree.
prettier --debug-check $(JS_CSS_CODE_LOCS)
prettier --write $(JS_CSS_CODE_LOCS)
# This target checks to make sure all of the JS and CSS code *is* compliant
# with prettier. Will be run on Travis.
festylecheck:
prettier --check $(JS_CSS_CODE_LOCS)