From d38cc1bfbe1f33dc36a54466dede44f57324f944 Mon Sep 17 00:00:00 2001 From: jared Date: Mon, 13 Apr 2026 20:34:21 -0400 Subject: [PATCH] ci: add phpcs and eslint linting workflow --- .eslintrc.json | 17 +++++++++++++++++ .gitea/workflows/lint.yml | 35 +++++++++++++++++++++++++++++++++++ .phpcs.xml | 16 ++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 .eslintrc.json create mode 100644 .gitea/workflows/lint.yml create mode 100644 .phpcs.xml diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..3a1921f --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "env": { + "browser": true, + "es2021": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 2021, + "sourceType": "script" + }, + "rules": { + "no-unused-vars": "warn", + "no-console": "off", + "semi": ["error", "always"], + "eqeqeq": ["error", "always"] + } +} diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml new file mode 100644 index 0000000..28ad307 --- /dev/null +++ b/.gitea/workflows/lint.yml @@ -0,0 +1,35 @@ +name: Lint + +on: + push: + branches: ["**"] + pull_request: + branches: ["**"] + +jobs: + php-lint: + name: PHP (phpcs PSR-12) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install PHP_CodeSniffer + run: | + curl -sL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o /usr/local/bin/phpcs + chmod +x /usr/local/bin/phpcs + + - name: Run phpcs + run: phpcs --standard=.phpcs.xml . + + js-lint: + name: JS (eslint) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install ESLint + run: npm install --save-dev eslint@8 + + - name: Run ESLint + run: npx eslint assets/js/ + diff --git a/.phpcs.xml b/.phpcs.xml new file mode 100644 index 0000000..0ae38c7 --- /dev/null +++ b/.phpcs.xml @@ -0,0 +1,16 @@ + + + PSR-12 with project-specific exclusions + + . + */uploads/* + */migrations/* + */.gitea/* + + + + + + + +