diff --git a/.github/workflows/link.yml b/.github/workflows/link.yml new file mode 100644 index 000000000..7783e2a75 --- /dev/null +++ b/.github/workflows/link.yml @@ -0,0 +1,25 @@ +name: "Coding Standards" + +on: + pull_request: + branches: + - "master" + paths: + - .github/workflows/lint.yml + - composer.* + - lib/** + - phpcs.xml.dist + - tests/** + push: + branches: + - "master" + paths: + - .github/workflows/lint.yml + - composer.* + - lib/** + - phpcs.xml.dist + - tests/** + +jobs: + coding-standards: + uses: "doctrine/.github/.github/workflows/coding-standards.yml@4.0.0" diff --git a/.gitignore b/.gitignore index 4a2fca764..b40368046 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ tests/DoctrineTest/doctrine_tests/* /tests/tmp /tests/foo.sq3 /vendor/ +/.phpcs-cache +/phpcs.xml diff --git a/composer.json b/composer.json index befc24307..3084ba2e4 100644 --- a/composer.json +++ b/composer.json @@ -39,5 +39,13 @@ "branch-alias": { "dev-master": "1.4-dev" } + }, + "require-dev": { + "doctrine/coding-standard": "^12.0" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 000000000..aa5a0df90 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + lib + tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +