diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1373161286b2f6e7f26e5439ad9953a82e0e09cc..056a283ce3e48984fc2f2d5611c2dd0147b8d5a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -122,7 +122,7 @@ ivette: - node --version - npm --version - yarn --version - - make -C ivette lint dome-app + - make -C ivette check-lint dome-app tags: - docker diff --git a/ivette/Makefile b/ivette/Makefile index 137f743ac2696b9cd67ca6a2343e85c840a77ef7..b694783457496828c58a63b8584feafcd05ae459 100644 --- a/ivette/Makefile +++ b/ivette/Makefile @@ -35,21 +35,34 @@ COPYRIGHT=CEA LIST / LSL # --- Ivette Compilation # -------------------------------------------------------------------------- -.PHONY: all app dev lint checkcase tsc +.PHONY: all app dev -all: pkg lint app +all: pkg check-lint app app: api dome-app dev: api dome-dev -lint: dome-pkg dome-templ checkcase +# -------------------------------------------------------------------------- +# --- Ivette Linting +# -------------------------------------------------------------------------- + +.PHONY: lint check-lint check-case + +# With autofix +lint: dome-pkg dome-templ check-case + @echo "[Ivette] running typechecker & linter (with cache & fix mode)" + yarn run typecheck + yarn run lint --fix --cache --cache-location .eslint-cache + +# Without autofix +check-lint: dome-pkg dome-templ check-case @echo "[Ivette] running typechecker & linter" yarn run typecheck yarn run lint # In case-insensitive filesystems (macOS/Windows), import statements and # filenames can have issues due to case differences -checkcase: +check-case: @echo "[Ivette] check case issues in imported filenames" @err=0 ; for f in `find src | sed -E 's/(.ts|.tsx|.js|.jsx|.css|.json)$$//' | sort -f | uniq -di` ;\ do \ @@ -58,11 +71,6 @@ checkcase: done ;\ exit $$err -tsc: dome-pkg dome-templ - @echo "[Ivette] running typechecker & linter (with cache & fix mode)" - yarn run typecheck - yarn run lint --fix --cache --cache-location .eslint-cache - # -------------------------------------------------------------------------- # --- Help # -------------------------------------------------------------------------- @@ -77,12 +85,12 @@ help:: .PHONY: dist dist-dir +dist: dist-dir dome-dist + dist-dir: @echo "Cleaning dist" @rm -fr dist -dist: dist-dir dome-dist - # -------------------------------------------------------------------------- # --- Ivette Package Loader # -------------------------------------------------------------------------- @@ -94,7 +102,6 @@ SANDBOX=src/renderer/sandbox.ts PACKAGES=$(shell find src -name "pkg.json") SANDBOXES=$(shell find src/sandbox -name "*.tsx") -lint: pkg dome-pkg: pkg dome-app: pkg dome-dev: pkg @@ -118,7 +125,7 @@ $(SANDBOX): $(SANDBOXES) ./sandboxer.js ./Makefile # --- Frama-C API # -------------------------------------------------------------------------- -.PHONY: api +.PHONY: api check-api api: @echo "[Ivette] Generating TypeScript API"