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

feat: grandfather current static analysis failures #551

Merged
merged 1 commit into from
Dec 6, 2021
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
feat: grandfather current static analysis failures
We want to begin using static analysis to improve the code base,
but we don't want to go back through the 760+ current issues before
doing so. This commit uses the Psalm baseline functionality to
grandfather in the current failures and adds psalm static analysis
to the test cycle. This will catch future issues in the code, while
allowing for gradual remediation of historical issues.
  • Loading branch information
Bishop Bettini committed Dec 2, 2021
commit 37e17a2e097dc1cd9b28a290a9fd834e102c824a
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"docker-run": "docker run -it -v \"${PWD}\":/opt/rollbar/rollbar-php rollbar/rollbar-php:3",
"test": [
"phpcs --standard=PSR2 src tests",
"psalm --long-progress --use-baseline=psalm.baseline",
"phpunit --coverage-clover build/logs/clover.xml --testsuite 'Rollbar Test Suite'"
],
"fix": "phpcbf --standard=PSR2 src tests",
Expand Down
24 changes: 24 additions & 0 deletions psalm.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.13.1@5cf660f63b548ccd4a56f62d916ee4d6028e01a3">
<file src="src/Rollbar.php">
<AssignmentToVoid occurrences="1">
<code>$result</code>
</AssignmentToVoid>
</file>
<file src="src/RollbarLogger.php">
<ParamNameMismatch occurrences="1">
<code>$toLog</code>
</ParamNameMismatch>
</file>
<file src="src/Senders/FluentSender.php">
<UndefinedClass occurrences="2">
<code>FluentLogger</code>
<code>FluentLogger</code>
</UndefinedClass>
<UndefinedDocblockClass occurrences="3">
<code>$this-&gt;fluentLogger</code>
<code>FluentLogger</code>
<code>private $fluentLogger = null;</code>
</UndefinedDocblockClass>
</file>
</files>
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm.baseline"
>
<projectFiles>
<directory name="src" />
Expand Down