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

View file

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

View file

@ -44,7 +44,7 @@
"@babel/core": "^7.26.9",
"@babel/eslint-parser": "^7.26.8",
"@babel/preset-env": "^7.26.9",
"@symfony/webpack-encore": "^4.7.0",
"@symfony/webpack-encore": "^5.0.1",
"autoprefixer": "^10.4.20",
"babel-loader": "^9.2.1",
"core-js": "^3.23.0",
@ -67,7 +67,6 @@
"stylelint-config-standard": "^34.0.0",
"stylelint-config-standard-scss": "^11.1.0",
"stylelint-scss": "^5.3.2",
"stylelint-webpack-plugin": "^5.0.1",
"terser-webpack-plugin": "^5.3.11",
"url-loader": "^4.1.1",
"webpack": "^5.98.0",
@ -102,6 +101,8 @@
"dev-server": "encore dev-server",
"build:dev": "encore dev",
"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 StyleLintPlugin = require('stylelint-webpack-plugin');
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
@ -23,14 +22,6 @@ Encore
})
.enableSassLoader()
.enablePostCssLoader()
.autoProvidejQuery()
.enableEslintPlugin()
.addPlugin(new StyleLintPlugin({
configFile: 'stylelint.config.js',
failOnError: false,
quiet: false,
context: 'assets',
files: '**/*.scss',
}));
.autoProvidejQuery();
module.exports = Encore.getWebpackConfig();

808
yarn.lock

File diff suppressed because it is too large Load diff