Forrest logo
back to the psalm tool

psalm:tldr:4ed92

psalm: Generate a Psalm configuration.
$ psalm --init
try on your machine

The command psalm --init is used to initialize a configuration file for the Psalm static analysis tool.

When you run this command, Psalm creates a configuration file named psalm.xml in the root directory of your project. This file contains various settings and options that control how Psalm analyzes your codebase.

The --init flag tells Psalm to initialize a new configuration file with default settings. This is useful when you are using Psalm for the first time or if you want to start with a fresh configuration file.

After running psalm --init, you can open the generated psalm.xml file and modify its contents according to your project's specific needs. You can configure things like which files or directories to exclude from analysis, what level of strictness to enforce, which plugins to use, and various other options.

Once your psalm.xml file is properly configured, you can run psalm command without the --init flag to analyze your codebase using the specified settings.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the psalm tool