From 3ec75b8036e29de8d843dd8b5855a3ea0e140652 Mon Sep 17 00:00:00 2001 From: yaozm Date: Sat, 17 Jun 2023 22:31:05 +0800 Subject: [PATCH] Update rector config file --- .editorconfig | 6 +----- .github/workflows/rector.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/rector.yml diff --git a/.editorconfig b/.editorconfig index 2aa7305..5f07773 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,9 +15,5 @@ insert_final_newline = true [*.md] trim_trailing_whitespace = false -[*.{yaml,yml}] -indent_size = 2 -insert_final_newline = true - -[*.{xml,xml.dist}] +[*.{yml,yaml,xml,xml.dist}] indent_size = 2 diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml new file mode 100644 index 0000000..a6e1dc1 --- /dev/null +++ b/.github/workflows/rector.yml @@ -0,0 +1,36 @@ +name: rector + +on: + push: + paths: + - '**.php' + - '.github/**.yml' + - '.github/**.yaml' + - '*.xml' + - '*.xml.dist' + +jobs: + rector: + name: rector + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.2' + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + path: vendor + key: composer-${{ hashFiles('composer.lock') }} + + - name: Run composer install + run: composer install --no-interaction --prefer-dist --ansi -v + + - name: Run rector + run: composer rector-dry-run