Merge pull request #8002 from wallabag/remove-linters-from-build-process

Remove linters from build process
This commit is contained in:
Kevin Decherf 2025-02-17 12:14:13 +01:00 committed by GitHub
commit d66c3ef75e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 278 additions and 588 deletions

View file

@ -55,3 +55,7 @@ To run the tests locally run `make test`.
To run the PHP formatter run `make fix-cs`. To run the PHP formatter run `make fix-cs`.
To run the PHPStan static analysis run `make phpstan`. To run the PHPStan static analysis run `make phpstan`.
To run the JS linter run `make lint-js`.
To run the SCSS linter run `make lint-scss`.

View file

@ -30,6 +30,12 @@ jobs:
env: env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Install Node"
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: 'yarn'
- name: "Setup MySQL" - name: "Setup MySQL"
run: | run: |
sudo systemctl start mysql.service sudo systemctl start mysql.service
@ -37,27 +43,48 @@ jobs:
cp app/config/tests/parameters_test.mysql.yml app/config/parameters_test.yml cp app/config/tests/parameters_test.mysql.yml app/config/parameters_test.yml
- name: "Install dependencies with Composer" - name: "Install dependencies with Composer"
id: composer-install
uses: "ramsey/composer-install@v3" uses: "ramsey/composer-install@v3"
with: with:
composer-options: "--optimize-autoloader --prefer-dist" composer-options: "--optimize-autoloader --prefer-dist"
- name: "Install dependencies with Yarn"
id: yarn-install
run: yarn install
- name: "Run Composer validate" - name: "Run Composer validate"
if: always() && steps.composer-install.outcome == 'success'
run: "composer validate" run: "composer validate"
- name: "Run Composer dependency analyser" - name: "Run Composer dependency analyser"
if: always() && steps.composer-install.outcome == 'success'
run: "bin/composer-dependency-analyser" run: "bin/composer-dependency-analyser"
- name: "Run PHP CS Fixer" - name: "Run PHP CS Fixer"
if: always() && steps.composer-install.outcome == 'success'
run: "bin/php-cs-fixer fix --verbose --dry-run --format=checkstyle | cs2pr" run: "bin/php-cs-fixer fix --verbose --dry-run --format=checkstyle | cs2pr"
- name: "Generate test cache for PHPStan" - name: "Generate test cache for PHPStan"
id: test-cache
if: always() && steps.composer-install.outcome == 'success'
run: "php bin/console cache:clear --env=test" run: "php bin/console cache:clear --env=test"
- name: "Run PHPStan" - name: "Run PHPStan"
if: always() && steps.test-cache.outcome == 'success'
run: "php bin/phpstan analyse --no-progress --error-format=checkstyle | cs2pr" run: "php bin/phpstan analyse --no-progress --error-format=checkstyle | cs2pr"
- name: "Run TwigCS" - name: "Run TwigCS"
if: always() && steps.composer-install.outcome == 'success'
run: "php bin/twigcs --severity=error --display=blocking --reporter checkstyle app/ src/ | cs2pr" run: "php bin/twigcs --severity=error --display=blocking --reporter checkstyle app/ src/ | cs2pr"
- name: "Run ergebnis/composer-normalize" - name: "Run ergebnis/composer-normalize"
if: always() && steps.composer-install.outcome == 'success'
run: "composer normalize --dry-run --no-check-lock" run: "composer normalize --dry-run --no-check-lock"
- name: "Run ESLint"
if: always() && steps.yarn-install.outcome == 'success'
run: "yarn lint:js"
- name: "Run Stylelint"
if: always() && steps.yarn-install.outcome == 'success'
run: "yarn lint:scss"

View file

@ -52,6 +52,12 @@ fix-cs: ## Run PHP-CS-Fixer
phpstan: ## Run PHPStan phpstan: ## Run PHPStan
@$(PHP_NO_XDEBUG) bin/phpstan analyse @$(PHP_NO_XDEBUG) bin/phpstan analyse
lint-js: ## Run ESLint
@$(YARN) lint:js
lint-scss: ## Run Stylelint
@$(YARN) lint:scss
release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`). release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
ifndef VERSION ifndef VERSION
$(error VERSION is not set) $(error VERSION is not set)

View file

@ -12,8 +12,7 @@ RUN apt-get update \
openssl \ openssl \
software-properties-common software-properties-common
RUN curl 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key' | apt-key add - \ RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash -
&& echo "deb https://deb.nodesource.com/node_${NODE_VERSION}.x $(lsb_release -cs) main" > /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
libmcrypt-dev \ libmcrypt-dev \

View file

@ -44,7 +44,7 @@
"@babel/core": "^7.26.9", "@babel/core": "^7.26.9",
"@babel/eslint-parser": "^7.26.8", "@babel/eslint-parser": "^7.26.8",
"@babel/preset-env": "^7.26.9", "@babel/preset-env": "^7.26.9",
"@symfony/webpack-encore": "^4.7.0", "@symfony/webpack-encore": "^5.0.1",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"babel-loader": "^9.2.1", "babel-loader": "^9.2.1",
"core-js": "^3.23.0", "core-js": "^3.23.0",
@ -67,7 +67,6 @@
"stylelint-config-standard": "^34.0.0", "stylelint-config-standard": "^34.0.0",
"stylelint-config-standard-scss": "^11.1.0", "stylelint-config-standard-scss": "^11.1.0",
"stylelint-scss": "^5.3.2", "stylelint-scss": "^5.3.2",
"stylelint-webpack-plugin": "^5.0.1",
"terser-webpack-plugin": "^5.3.11", "terser-webpack-plugin": "^5.3.11",
"url-loader": "^4.1.1", "url-loader": "^4.1.1",
"webpack": "^5.98.0", "webpack": "^5.98.0",
@ -102,6 +101,8 @@
"dev-server": "encore dev-server", "dev-server": "encore dev-server",
"build:dev": "encore dev", "build:dev": "encore dev",
"watch": "encore dev --watch", "watch": "encore dev --watch",
"build:prod": "encore production --progress" "build:prod": "encore production --progress",
"lint:js": "eslint assets/*.js assets/js/*.js assets/js/**/*.js",
"lint:scss": "stylelint assets/scss/*.scss assets/scss/**/*.scss"
} }
} }

View file

@ -1,5 +1,4 @@
const Encore = require('@symfony/webpack-encore'); const Encore = require('@symfony/webpack-encore');
const StyleLintPlugin = require('stylelint-webpack-plugin');
if (!Encore.isRuntimeEnvironmentConfigured()) { if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev'); Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
@ -23,14 +22,6 @@ Encore
}) })
.enableSassLoader() .enableSassLoader()
.enablePostCssLoader() .enablePostCssLoader()
.autoProvidejQuery() .autoProvidejQuery();
.enableEslintPlugin()
.addPlugin(new StyleLintPlugin({
configFile: 'stylelint.config.js',
failOnError: false,
quiet: false,
context: 'assets',
files: '**/*.scss',
}));
module.exports = Encore.getWebpackConfig(); module.exports = Encore.getWebpackConfig();

808
yarn.lock

File diff suppressed because it is too large Load diff