diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml new file mode 100644 index 0000000..4d1176b --- /dev/null +++ b/.github/workflows/phpcs.yml @@ -0,0 +1,29 @@ +name: "CI" + +on: + pull_request: + paths: + - "**.php" + - "phpcs.xml" + - ".github/workflows/phpcs.yml" + +jobs: + phpcs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # important! + + # we may use whatever way to install phpcs, just specify the path on the next step + # however, curl seems to be the fastest + - name: Install PHP_CodeSniffer + run: | + curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar + php phpcs.phar --version + + - uses: tinovyatkin/action-php-codesniffer@v1 + with: + files: "**.php" # you may customize glob as needed + phpcs_path: php phpcs.phar + standard: phpcs.xml diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..c9dfc72 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,154 @@ + + + The coding standard for PHP_CodeSniffer itself. + + autoload.php + bin + scripts + src + tests + + */src/Standards/*/Tests/*\.(inc|css|js)$ + */tests/Core/*/*\.(inc|css|js)$ + + + + + + + + + error + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + error + + + + + error + + + + + tests/bootstrap\.php + + + + + tests/Core/Tokenizer/StableCommentWhitespaceWinTest\.php + + + diff --git a/src/Test.php b/src/Test.php new file mode 100644 index 0000000..2c69660 --- /dev/null +++ b/src/Test.php @@ -0,0 +1,25 @@ +