Skip to content

Commit

Permalink
Setup static analysis
Browse files Browse the repository at this point in the history
I select levels that do not involve any code change.
  • Loading branch information
greg0ire committed Jun 2, 2023
1 parent 8cffffb commit 11520c1
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Static Analysis"

on:
pull_request:
branches:
- "master"
paths:
- .github/workflows/static-analysis.yml
- composer.*
- lib/**
- phpstan*
- psalm*
- tests
push:
branches:
- "master"
paths:
- .github/workflows/static-analysis.yml
- composer.*
- lib/**
- phpstan*
- psalm*
- tests

jobs:
static-analysis:
name: "Static Analysis"
uses: "doctrine/.github/.github/workflows/[email protected]"
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"php": "^7.1|^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9",
"phpunit/phpunit": "^7.5|^8.5|^9.5",
"phpstan/phpstan": "1.4.10 || 1.10.15",
"psr/log": "^1|^2|^3",
"doctrine/coding-standard": "^9"
"vimeo/psalm": "4.30.0 || 5.12.0"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 3
paths:
- lib
- tests
17 changes: 17 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<psalm
errorLevel="4"
resolveFromConfigFile="true"
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"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="lib/Doctrine/Deprecations" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>

0 comments on commit 11520c1

Please sign in to comment.