From 47e09c088079c87f5e459e7492ac98905d341609 Mon Sep 17 00:00:00 2001 From: mscherer Date: Tue, 19 Oct 2021 19:54:19 +0200 Subject: [PATCH] Fix up composer command. --- .github/workflows/ci.yml | 7 +++---- bin/sniff.php | 3 ++- bin/tokenize.php | 3 ++- composer.json | 4 ++-- phpcs.xml | 15 +++++++++++++++ 5 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 phpcs.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 801ff76..fdad7e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,12 +3,11 @@ name: CI on: push: pull_request: - schedule: - - cron: "0 0 * * *" + workflow_dispatch: jobs: testsuite: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: @@ -56,7 +55,7 @@ jobs: validation: name: Coding Standard & Static Analysis - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 diff --git a/bin/sniff.php b/bin/sniff.php index a32e478..3e7fda3 100644 --- a/bin/sniff.php +++ b/bin/sniff.php @@ -3,7 +3,7 @@ $options = [ __DIR__ . '/../vendor/autoload.php', - __DIR__ . '/vendor/autoload.php' + __DIR__ . '/vendor/autoload.php', ]; if (!empty($_SERVER['PWD'])) { array_unshift($options, $_SERVER['PWD'] . '/vendor/autoload.php'); @@ -12,6 +12,7 @@ foreach ($options as $file) { if (file_exists($file)) { define('SNIFFER_COMPOSER_INSTALL', $file); + break; } } diff --git a/bin/tokenize.php b/bin/tokenize.php index 7630a15..010b474 100644 --- a/bin/tokenize.php +++ b/bin/tokenize.php @@ -3,7 +3,7 @@ $options = [ __DIR__ . '/../vendor/autoload.php', - __DIR__ . '/vendor/autoload.php' + __DIR__ . '/vendor/autoload.php', ]; if (!empty($_SERVER['PWD'])) { array_unshift($options, $_SERVER['PWD'] . '/vendor/autoload.php'); @@ -12,6 +12,7 @@ foreach ($options as $file) { if (file_exists($file)) { define('SNIFFER_COMPOSER_INSTALL', $file); + break; } } diff --git a/composer.json b/composer.json index d7e0adc..86a6d38 100644 --- a/composer.json +++ b/composer.json @@ -37,8 +37,8 @@ "scripts": { "docs": "php docs/generate.php", "docs-listing": "phpcs -e --standard=PSR2R/ruleset.xml", - "cs-check": "phpcs --standard=PSR2R/ruleset.xml -p -s --ignore=/tests/files/,*.inc,*.fixed PSR2R/", - "cs-fix": "phpcbf --standard=PSR2R/ruleset.xml -p --ignore=/tests/files/,*.inc,*.fixed PSR2R/", + "cs-check": "phpcs", + "cs-fix": "phpcbf", "test": "php phpunit.phar", "test-setup": "[ ! -f phpunit.phar ] && wget https://phar.phpunit.de/phpunit-8.5.1.phar && mv phpunit-8.5.1.phar phpunit.phar || true", "test-setup-mac": "[ ! -f phpunit.phar ] && curl -OL https://phar.phpunit.de/phpunit-8.5.1.phar && mv phpunit-8.5.1.phar phpunit.phar || true", diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..79f41e0 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,15 @@ + + + + + + + PSR2R/ + docs/ + bin/ + + + + /tests/files/,*.inc,*.fixed + +