From c9980ed099d820f56c2c50151af8fd0af0135d77 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 14 Apr 2020 17:44:08 +0200 Subject: [PATCH 1/3] Add php-cs check action Signed-off-by: Christoph Wurst --- .github/workflows/lint.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ca027676da..a6ff39144b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,3 +18,19 @@ jobs: coverage: none - name: Lint run: composer run lint + + php-cs-fixer: + name: php-cs check + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + - name: Set up php + uses: shivammathur/setup-php@master + with: + php-version: 7.4 + coverage: none + - name: Install dependencies + run: composer i + - name: Run coding standards check + run: composer run cs:check From 833d1d2c3b12b36332ee342e3c228191fb96b4c3 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 14 Apr 2020 17:53:44 +0200 Subject: [PATCH 2/3] Fix php-cs formatting Signed-off-by: Christoph Wurst --- apps/provisioning_api/tests/Controller/GroupsControllerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php index 34bcdd4e64..72f0cd5537 100644 --- a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php +++ b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php @@ -558,7 +558,7 @@ class GroupsControllerTest extends \Test\TestCase { $this->userManager->expects($this->any()) ->method('get') - ->willReturnCallback(function(string $uid) use ($users) { + ->willReturnCallback(function (string $uid) use ($users) { return isset($users[$uid]) ? $users[$uid] : null; }); From 9e6fcd585b5632834279cfa38d33d7c79f5197e9 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 14 Apr 2020 18:29:09 +0200 Subject: [PATCH 3/3] Show a hint for the php-cs fix when the check fails Signed-off-by: Christoph Wurst --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a6ff39144b..4de6de6865 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,4 +33,4 @@ jobs: - name: Install dependencies run: composer i - name: Run coding standards check - run: composer run cs:check + run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )