Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add psalm #108

Merged
merged 7 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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: Static analysis

on: pull_request

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

jobs:
static-analysis:
runs-on: ubuntu-latest

name: static-psalm-analysis
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, mysql, pdo_mysql, ldap
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: composer i

- name: Run coding standards check
run: composer run psalm
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
},
"require-dev": {
"phpunit/phpunit": "^9",
"nextcloud/coding-standard": "^1.0.0",
"nextcloud/ocp": "dev-master"
"nextcloud/coding-standard": "^1.1",
"nextcloud/ocp": "dev-master",
"vimeo/psalm": "^5.18",
"sabre/dav": "4.5.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you use it directly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
"require": {
"symfony/ldap": "^5.0"
Expand All @@ -25,7 +27,10 @@
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"test:unit": "vendor/bin/phpunit -c tests/phpunit.xml"
"test:unit": "vendor/bin/phpunit -c tests/phpunit.xml",
"psalm": "psalm --no-cache --threads=$(nproc)",
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
"psalm:update-baseline": "psalm --threads=1 --update-baseline"
},
"autoload-dev": {
"psr-4": {
Expand Down
Loading
Loading