Skip to content

Use level 4 by default and level info instead of suppress#881

Merged
alies-dev merged 2 commits intomasterfrom
init-config-info
May 5, 2026
Merged

Use level 4 by default and level info instead of suppress#881
alies-dev merged 2 commits intomasterfrom
init-config-info

Conversation

@alies-dev
Copy link
Copy Markdown
Collaborator

Exclude tests dir by default as it requires other Psalm plugins plus makes dead code detection less usable.

alies-dev added 2 commits May 5, 2026 23:28
exclude tests dir by default as it requires other Psalm plugins
plus makes dead code detection less usable
exclude tests dir by default as it requires other Psalm plugins
plus makes dead code detection less usable
@alies-dev alies-dev requested a review from Copilot May 5, 2026 21:32
@alies-dev alies-dev self-assigned this May 5, 2026
@alies-dev alies-dev added the release:minor for PRs only (used by release-drafter) label May 5, 2026
@alies-dev alies-dev merged commit a68f5b8 into master May 5, 2026
36 checks passed
@alies-dev alies-dev deleted the init-config-info branch May 5, 2026 21:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the generated psalm.xml defaults produced by the init CLI command to be less strict/noisy out of the box for Laravel projects, and to avoid analyzing the tests/ directory by default.

Changes:

  • Change the default Psalm errorLevel used by init from 3 to 4.
  • Update multiple issue handlers in the generated config from errorLevel="suppress" to errorLevel="info" (and add ImplicitToStringCast as info).
  • Exclude the tests/ directory by default in the generated config (with an inline note about optional PHPUnit/Mockery plugins).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/Unit/Cli/InitCommandTest.php Updates assertions to reflect the new default error level and issue handler severities.
src/Cli/InitCommand.php Updates the psalm.xml template defaults (error level, ignored paths, issue handler levels).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

$this->assertStringContainsString('<pluginClass class="Psalm\\LaravelPlugin\\Plugin"/>', $contents);
$this->assertStringContainsString('<directory name="vendor"/>', $contents);
$this->assertStringContainsString('<directory name="storage"/>', $contents);
$this->assertStringContainsString('<directory name="bootstrap/cache"/>', $contents);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:minor for PRs only (used by release-drafter)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants