Skip to content

Commit

Permalink
Report unused baseline entries
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-worman committed Jan 18, 2023
1 parent 4e35dfa commit 665c90f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
4 changes: 4 additions & 0 deletions docs/running_psalm/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,10 @@ class PremiumCar extends StandardCar {
```
`ImplementedReturnTypeMismatch - The inherited return type 'list{'motor', 'brakes', 'wheels'}' for StandardCar::getSystems is different to the implemented return type for PremiumCar::getsystems 'list{'motor', 'brakes', 'wheels', 'rear parking sensor'}'`

#### findUnusedBaselineEntry

Emits [UnusedBaselineEntry](issues/UnusedBaselineEntry.md) when a baseline entry
is not being used to suppress an issue.

## Project settings

Expand Down
4 changes: 3 additions & 1 deletion docs/running_psalm/issues/UnusedBaselineEntry.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# UnusedBaselineEntry

Emitted when
Emitted when a baseline entry is not being used to suppress an issue.

Enabled by [findUnusedBaselineEntry](../configuration.md#findunusedbaselineentry)
5 changes: 0 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -701,11 +701,6 @@
<code>hasLowercaseString</code>
</PossiblyUnusedMethod>
</file>
<file src="tests/Internal/Codebase/InternalCallMapHandlerTest.php">
<UnusedPsalmSuppress>
<code>UndefinedMethod</code>
</UnusedPsalmSuppress>
</file>
<file src="vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php">
<PossiblyUndefinedStringArrayOffset>
<code>$subNodes['expr']</code>
Expand Down
1 change: 0 additions & 1 deletion src/Psalm/IssueBuffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,6 @@ public static function finish(
}
}

// Check for unused baseline
if ($codebase->config->find_unused_baseline_entry) {
foreach ($issue_baseline as $file_path => $issues) {
foreach ($issues as $issue_name => $issue) {
Expand Down
1 change: 0 additions & 1 deletion tests/Internal/Codebase/InternalCallMapHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,6 @@ private function assertParameter(array $normalizedEntry, ReflectionParameter $pa
}
}

/** @psalm-suppress UndefinedMethod */
public function assertEntryReturnType(ReflectionFunctionAbstract $function, string $entryReturnType): void
{
if (version_compare(PHP_VERSION, '8.1.0', '>=')) {
Expand Down

0 comments on commit 665c90f

Please sign in to comment.