Skip to content

Commit

Permalink
Merge pull request #585 from nextcloud/ArtificialOwl-patch-4
Browse files Browse the repository at this point in the history
Create lint-php-cs.yml
  • Loading branch information
ArtificialOwl committed Jan 2, 2024
2 parents 9853712 + 52d72ed commit b25437a
Show file tree
Hide file tree
Showing 30 changed files with 1,140 additions and 3,110 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Lint php-cs

on: pull_request

permissions:
contents: read

concurrency:
group: lint-php-cs-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest

name: php-cs

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up php8.2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: 8.2
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: composer i

- name: Lint
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
111 changes: 0 additions & 111 deletions .github/workflows/lint.yml

This file was deleted.

14 changes: 11 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"classmap-authoritative": true,
"autoloader-suffix": "Backup",
"platform": {
"php": "7.4"
"php": "8.1"
}
},
"authors": [
Expand All @@ -24,13 +24,21 @@
},
"require": {
"ifsnop/mysqldump-php": "2.12",
"spatie/db-dumper": "2.21.1",
"spatie/db-dumper": "^3.4",
"pimple/pimple": "~3.0"
},
"scripts": {
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
"psalm": "psalm --threads=1 --update-baseline",
"psalm:update-baseline": "psalm --threads=1 --update-baseline",
"psalm:clear": "psalm --clear-cache && psalm --clear-global-cache",
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
"test": [
"@test:unit"
],
"test:unit": "vendor/bin/phpunit -c tests/phpunit.xml"
},
"require-dev": {
"nextcloud/coding-standard": "^1.0.0",
Expand Down
Loading

0 comments on commit b25437a

Please sign in to comment.