From 423e925844d0251f0c795a8b569d6c1a0239c014 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Loi=CC=88c=20Correnson?= <loic.correnson@cea.fr>
Date: Fri, 21 Apr 2023 10:04:32 +0200
Subject: [PATCH] [ivette] fixed lint rules in makefiles and C/I

---
 .gitlab-ci.yml  |  2 +-
 ivette/Makefile | 33 ++++++++++++++++++++-------------
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1373161286b..056a283ce3e 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 137f743ac26..b6947834574 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"
-- 
GitLab