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 as a static analysis tool. #376

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@
</exec>
</target>

<target name="psalm" description="Display Psalm analysis">
<exec executable="${basedir}/tools/psalm">
<arg line="-c=${basedir}/psalm.xml" />
<arg line="--output-format=compact" />
</exec>
</target>

<target name="psalm-ci" description="Generate psalm.xml">
<exec executable="${basedir}/tools/psalm" output="${basedir}/build/logs/psalm.xml">
<arg line="-c=${basedir}/psalm.xml" />
<arg line="--show-info=false" />
<arg line="--output-format=xml" />
<arg line="--no-progress" />
</exec>
</target>

<target name="api">
<delete dir="${basedir}/build/api" />
<exec executable="${basedir}/phpdox" />
Expand Down
1 change: 1 addition & 0 deletions phive.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
<phar name="phploc" version="^3.0.1" installed="3.0.1" location="./tools/phploc" copy="false"/>
<phar name="phpunit" version="^7.0" installed="7.5.3" location="./tools/phpunit" copy="false"/>
<phar name="phpab" version="^1.25.2" installed="1.25.2" location="./tools/phpab" copy="false"/>
<phar name="psalm" version="^4.6.1" installed="4.6.1" location="./tools/psalm" copy="false"/>
</phive>
15 changes: 15 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<psalm
errorLevel="7"
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"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>