Skip to content

Commit

Permalink
Move Psalm to tools
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Sep 20, 2024
1 parent 727a192 commit 3207c9e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ jobs:
with:
php-version: "8.3"

- name: Install composer dependencies
- name: Install composer dependencies (date-time)
uses: ramsey/composer-install@v3

- name: Install composer dependencies (psalm)
uses: ramsey/composer-install@v3
with:
working-directory: "tools/psalm"

- name: Run Psalm
run: vendor/bin/psalm --show-info=false --find-unused-psalm-suppress --no-progress
run: tools/psalm/vendor/bin/psalm --show-info=false --no-progress --config=tools/psalm/psalm.xml
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
/tools/rector/*
!/tools/rector/composer.json
!/tools/rector/rector.php
!/tools/psalm
/tools/psalm/*
!/tools/psalm/composer.json
!/tools/psalm/psalm.xml
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,16 @@ vendor/bin/phpunit

### Static analysis

Install Psalm in its own folder:

```sh
composer install --working-dir=tools/psalm
```

Run Psalm static analysis:

```sh
vendor/bin/psalm --no-cache
tools/psalm/vendor/bin/psalm --no-cache --config=tools/psalm/psalm.xml
```

### Coding Style
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"require-dev": {
"phpunit/phpunit": "^10.5",
"php-coveralls/php-coveralls": "^2.2",
"vimeo/psalm": "5.25.0",
"guzzlehttp/guzzle": "^7.0"
},
"suggest": {
Expand Down
5 changes: 5 additions & 0 deletions tools/psalm/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"vimeo/psalm": "^5.26"
}
}
2 changes: 1 addition & 1 deletion psalm.xml → tools/psalm/psalm.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
resolveFromConfigFile="true"
resolveFromConfigFile="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down

0 comments on commit 3207c9e

Please sign in to comment.