ci: add phpcs and eslint linting workflow
This commit is contained in:
@@ -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"]
|
||||
}
|
||||
}
|
||||
@@ -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/
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="TinkerTickets">
|
||||
<description>PSR-12 with project-specific exclusions</description>
|
||||
|
||||
<file>.</file>
|
||||
<exclude-pattern>*/uploads/*</exclude-pattern>
|
||||
<exclude-pattern>*/migrations/*</exclude-pattern>
|
||||
<exclude-pattern>*/.gitea/*</exclude-pattern>
|
||||
|
||||
<arg name="extensions" value="php"/>
|
||||
<arg name="colors"/>
|
||||
<arg value="sp"/>
|
||||
|
||||
<rule ref="PSR12"/>
|
||||
</ruleset>
|
||||
|
||||
Reference in New Issue
Block a user