diff --git a/config.xsd b/config.xsd index 1270a7bc7..c98038527 100644 --- a/config.xsd +++ b/config.xsd @@ -41,6 +41,7 @@ + diff --git a/docs/running_psalm/configuration.md b/docs/running_psalm/configuration.md index 87a15aeba..6431c1730 100644 --- a/docs/running_psalm/configuration.md +++ b/docs/running_psalm/configuration.md @@ -247,6 +247,14 @@ When `true`, Psalm will attempt to find all unused variables, the equivalent of ``` When `true`, Psalm will attempt to find all unused code (including unused variables), the equivalent of running with `--find-unused-code`. Defaults to `false`. +#### findUnusedPsalmSuppress +```xml + +``` +When `true`, Psalm will report all `@psalm-suppress` annotations that aren't used, the equivalent of running with `--find-unused-psalm-suppress`. Defaults to `false`. + #### loadXdebugStub ```xml 'use_phpstorm_meta_path', 'allowInternalNamedArgumentsCalls' => 'allow_internal_named_arg_calls', 'allowNamedArgumentCalls' => 'allow_named_arg_calls', + 'findUnusedPsalmSuppress' => 'find_unused_psalm_suppress', ]; foreach ($booleanAttributes as $xmlName => $internalName) { diff --git a/src/psalm.php b/src/psalm.php index 420b49421..87312891c 100644 --- a/src/psalm.php +++ b/src/psalm.php @@ -667,7 +667,7 @@ if ($config->run_taint_analysis || (isset($options['track-tainted-input']) $project_analyzer->trackTaintedInputs(); } -if (isset($options['find-unused-psalm-suppress'])) { +if ($config->find_unused_psalm_suppress || isset($options['find-unused-psalm-suppress'])) { $project_analyzer->trackUnusedSuppressions(); }