From 51f747823d295c1ea889e5cac468e5541266c6c7 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Thu, 5 Dec 2024 14:49:48 +0100 Subject: [PATCH] [Meta] Drop format, lint, check-format and check-lint commands, replace them with check and ci commands --- .github/workflows/test.yaml | 3 +-- CONTRIBUTING.md | 8 ++++---- package.json | 6 ++---- src/Autocomplete/assets/package.json | 6 ++---- src/Chartjs/assets/package.json | 6 ++---- src/Cropperjs/assets/package.json | 6 ++---- src/Dropzone/assets/package.json | 6 ++---- src/LazyImage/assets/package.json | 6 ++---- src/LiveComponent/assets/package.json | 6 ++---- src/Map/assets/package.json | 6 ++---- src/Map/src/Bridge/Google/assets/package.json | 6 ++---- src/Map/src/Bridge/Leaflet/assets/package.json | 6 ++---- src/Notify/assets/package.json | 6 ++---- src/React/assets/package.json | 6 ++---- src/StimulusBundle/assets/package.json | 6 ++---- src/Svelte/assets/package.json | 6 ++---- src/Swup/assets/package.json | 6 ++---- src/TogglePassword/assets/package.json | 6 ++---- src/Translator/assets/package.json | 6 ++---- src/Turbo/assets/package.json | 6 ++---- src/Typed/assets/package.json | 6 ++---- src/Vue/assets/package.json | 6 ++---- 22 files changed, 45 insertions(+), 86 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ae6a7495ed1..24dd1d62c4b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,8 +28,7 @@ jobs: restore-keys: | ${{ runner.os }}-yarn- - run: yarn --immutable - - run: yarn check-lint - - run: yarn check-format + - run: yarn ci js-dist-current: name: Check for UnBuilt JS Dist Files diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3a301907c69..1cfe2f9ee66 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,14 +81,14 @@ To help you with assets, you can run the following commands in a specific packag - `yarn run build`: build (compile) assets from the package, - `yarn run watch`: watch for modifications and rebuild assets from the package, - `yarn run test`: run the tests from the package, - - `yarn run lint`: lint assets from the package, - - `yarn run format`: format assets from the package. + - `yarn run check`: run the formatter, linter, and sort imports, and fails if any modifications + - `yarn run check --write`: run the formatter, linter, imports sorting, and write modifications Thanks to [Yarn Workspaces](https://yarnpkg.com/features/workspaces), you can also run these commands from the root directory of the project: - `yarn run build`: build (compile) assets from **all** packages, - `yarn run test`: run the tests from **all** packages, - - `yarn run lint`: lint assets from **all** packages, - - `yarn run format`: format assets from **all** packages, + - `yarn run check`: run the formatter, linter, and sort imports for **all** packages, and fails if any modifications + - `yarn run check --write`: run the formatter, linter, imports sorting for **all** packages, and write modifications ## Useful Git commands diff --git a/package.json b/package.json index 0952bdd9d58..e48cff66ba9 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,8 @@ "scripts": { "build": "yarn workspaces foreach -Apt run build", "test": "yarn workspaces foreach -Apt run test", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "devDependencies": { "@babel/core": "^7.25.2", diff --git a/src/Autocomplete/assets/package.json b/src/Autocomplete/assets/package.json index a7a238c50f2..2e992455f38 100644 --- a/src/Autocomplete/assets/package.json +++ b/src/Autocomplete/assets/package.json @@ -9,10 +9,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/Chartjs/assets/package.json b/src/Chartjs/assets/package.json index bfbab3f8cf5..82960890b4f 100644 --- a/src/Chartjs/assets/package.json +++ b/src/Chartjs/assets/package.json @@ -10,10 +10,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/Cropperjs/assets/package.json b/src/Cropperjs/assets/package.json index ee4b4e29c57..34b6421fd2b 100644 --- a/src/Cropperjs/assets/package.json +++ b/src/Cropperjs/assets/package.json @@ -12,10 +12,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/Dropzone/assets/package.json b/src/Dropzone/assets/package.json index 03c23dca910..2c157d752ea 100644 --- a/src/Dropzone/assets/package.json +++ b/src/Dropzone/assets/package.json @@ -12,10 +12,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/LazyImage/assets/package.json b/src/LazyImage/assets/package.json index 7f2c8d854f8..019448d14c6 100644 --- a/src/LazyImage/assets/package.json +++ b/src/LazyImage/assets/package.json @@ -9,10 +9,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/LiveComponent/assets/package.json b/src/LiveComponent/assets/package.json index 8e5ece78f03..166d566e945 100644 --- a/src/LiveComponent/assets/package.json +++ b/src/LiveComponent/assets/package.json @@ -12,10 +12,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/Map/assets/package.json b/src/Map/assets/package.json index 69ebc71be99..fd06d0b82bb 100644 --- a/src/Map/assets/package.json +++ b/src/Map/assets/package.json @@ -10,10 +10,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "importmap": { diff --git a/src/Map/src/Bridge/Google/assets/package.json b/src/Map/src/Bridge/Google/assets/package.json index 17322cf9241..300a21fd95f 100644 --- a/src/Map/src/Bridge/Google/assets/package.json +++ b/src/Map/src/Bridge/Google/assets/package.json @@ -10,10 +10,8 @@ "build": "node ../../../../../../bin/build_package.js .", "watch": "node ../../../../../../bin/build_package.js . --watch", "test": "../../../../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/Map/src/Bridge/Leaflet/assets/package.json b/src/Map/src/Bridge/Leaflet/assets/package.json index 1ac16b1d8f0..8145f0fb22d 100644 --- a/src/Map/src/Bridge/Leaflet/assets/package.json +++ b/src/Map/src/Bridge/Leaflet/assets/package.json @@ -10,10 +10,8 @@ "build": "node ../../../../../../bin/build_package.js .", "watch": "node ../../../../../../bin/build_package.js . --watch", "test": "../../../../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/Notify/assets/package.json b/src/Notify/assets/package.json index 37c98d79fc2..9eeaff5769f 100644 --- a/src/Notify/assets/package.json +++ b/src/Notify/assets/package.json @@ -9,10 +9,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/React/assets/package.json b/src/React/assets/package.json index 8f1b3d50f68..c6964a527d8 100644 --- a/src/React/assets/package.json +++ b/src/React/assets/package.json @@ -9,10 +9,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/StimulusBundle/assets/package.json b/src/StimulusBundle/assets/package.json index 4d0d2b401e9..426a2492965 100644 --- a/src/StimulusBundle/assets/package.json +++ b/src/StimulusBundle/assets/package.json @@ -8,10 +8,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "needsPackageAsADependency": false, diff --git a/src/Svelte/assets/package.json b/src/Svelte/assets/package.json index 7b80877f22f..38ab7b75ee7 100644 --- a/src/Svelte/assets/package.json +++ b/src/Svelte/assets/package.json @@ -8,10 +8,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/Swup/assets/package.json b/src/Swup/assets/package.json index 1cabd23f7ca..42c86d05f1e 100644 --- a/src/Swup/assets/package.json +++ b/src/Swup/assets/package.json @@ -9,10 +9,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/TogglePassword/assets/package.json b/src/TogglePassword/assets/package.json index 2e27fec2313..86a39696202 100644 --- a/src/TogglePassword/assets/package.json +++ b/src/TogglePassword/assets/package.json @@ -12,10 +12,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/Translator/assets/package.json b/src/Translator/assets/package.json index 6fd84918fb8..8fa315582f7 100644 --- a/src/Translator/assets/package.json +++ b/src/Translator/assets/package.json @@ -9,10 +9,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "importmap": { diff --git a/src/Turbo/assets/package.json b/src/Turbo/assets/package.json index bf086784874..931be09d363 100644 --- a/src/Turbo/assets/package.json +++ b/src/Turbo/assets/package.json @@ -10,10 +10,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/Typed/assets/package.json b/src/Typed/assets/package.json index d146fb639f9..e63ba5aa539 100644 --- a/src/Typed/assets/package.json +++ b/src/Typed/assets/package.json @@ -9,10 +9,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": { diff --git a/src/Vue/assets/package.json b/src/Vue/assets/package.json index 9b20a09f8af..a3b046ace0f 100644 --- a/src/Vue/assets/package.json +++ b/src/Vue/assets/package.json @@ -9,10 +9,8 @@ "build": "node ../../../bin/build_package.js .", "watch": "node ../../../bin/build_package.js . --watch", "test": "../../../bin/test_package.sh .", - "lint": "biome lint --write", - "format": "biome format --write", - "check-lint": "biome lint", - "check-format": "biome format" + "check": "biome check", + "ci": "biome ci" }, "symfony": { "controllers": {