From d3f0ee1d7534a42ee737dbb5b58221c479e00ede Mon Sep 17 00:00:00 2001 From: SonataCI Date: Wed, 12 Feb 2020 02:11:28 +0000 Subject: [PATCH] DevKit updates --- .github/workflows/lint.yml | 63 ++++++++++++++++++++++++++++++++++ .php_cs.dist | 1 + .travis.yml | 7 ---- .travis/check_relevant_lint.sh | 6 ---- .travis/install_lint.sh | 11 ------ Makefile | 2 +- 6 files changed, 65 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/lint.yml delete mode 100755 .travis/check_relevant_lint.sh delete mode 100755 .travis/install_lint.sh diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..e320afd5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,63 @@ +on: [push, pull_request] + +name: Lint + +jobs: + php-cs-fixer: + name: PHP-CS-Fixer + + runs-on: ubuntu-latest + + steps: + - name: "Checkout" + uses: actions/checkout@v2 + + - name: "Run PHP-CS-Fixer" + uses: docker://oskarstark/php-cs-fixer-ga:2.16.1 + with: + args: --ansi --verbose --diff --dry-run + + composer-normalize: + name: composer-normalize + + runs-on: ubuntu-latest + + steps: + - name: "Checkout" + uses: actions/checkout@v2 + + - name: "Run composer-normalize" + uses: docker://localheinz/composer-normalize-action:0.5.2 + with: + args: --dry-run + + yaml-files: + name: YAML files + + runs-on: ubuntu-latest + + steps: + - name: "Checkout" + uses: actions/checkout@v2 + + - name: "Install Ruby 2.6" + uses: actions/setup-ruby@v1 + with: + ruby-version: '2.6' + - run: gem install yaml-lint + - name: "Linting..." + run: make lint-yaml + + xml-files: + name: XML files + + runs-on: ubuntu-latest + + steps: + - name: "Checkout" + uses: actions/checkout@v2 + + - run: sudo apt-get install libxml2-utils + + - name: "Linting..." + run: make lint-xml diff --git a/.php_cs.dist b/.php_cs.dist index 063efb18..dd93021c 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -26,6 +26,7 @@ $rules = [ 'header_comment' => [ 'header' => $header, ], + 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], 'no_extra_blank_lines' => true, 'no_php4_constructor' => true, 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], diff --git a/.travis.yml b/.travis.yml index 6b7366b8..4bb45d60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,11 +20,6 @@ services: dist: xenial -addons: - apt: - packages: - - libxml2-utils - cache: pip: true directories: @@ -41,8 +36,6 @@ env: matrix: fast_finish: true include: - - php: '7.3' - env: TARGET=lint - php: '7.2' env: COMPOSER_FLAGS="--prefer-lowest" - php: '7.3' diff --git a/.travis/check_relevant_lint.sh b/.travis/check_relevant_lint.sh deleted file mode 100755 index 317cfecc..00000000 --- a/.travis/check_relevant_lint.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -set -ev - -RELEVANT_FILES=$(git diff --name-only HEAD upstream/${TRAVIS_BRANCH} -- '*.json' '*.yml' '*.xml' '*.xliff' '*.php') - -if [[ -z ${RELEVANT_FILES} ]]; then echo -n 'KO'; exit 0; fi; diff --git a/.travis/install_lint.sh b/.travis/install_lint.sh deleted file mode 100755 index 864c751e..00000000 --- a/.travis/install_lint.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env sh -set -ev - -mkdir --parents "${HOME}/bin" - -wget "http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar" --output-document="${HOME}/bin/php-cs-fixer" -chmod u+x "${HOME}/bin/php-cs-fixer" - -composer global require sllh/composer-lint:@stable --prefer-dist --no-interaction - -gem install yaml-lint diff --git a/Makefile b/Makefile index 80bf9629..3e7fd990 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ all: @echo "Please choose a task." .PHONY: all -lint: lint-composer lint-yaml lint-composer lint-xml lint-php +lint: lint-composer lint-yaml lint-xml lint-php .PHONY: lint lint-composer: