retina init command creates a retina.yml configuration file in your plugin directory with customizable analysis settings.
Basic usage
retina.yml file in the current directory with default configuration.
Arguments
Path to the plugin directory where the configuration file should be created. If not specified, uses the current directory.
Behavior
Configuration file exists
Configuration file exists
If
retina.yml already exists in the target directory, Retina will:- Display a warning message
- Ask for confirmation before overwriting
- Preserve the existing file if you decline
Generated configuration
The command creates aretina.yml file with the following structure:
retina.yml
Configuration options
After creating the file, Retina displays key configuration options:Analysis strictness level (1-9). Higher values apply stricter rules.
Directories to scan, relative to the plugin root. Default:
["src"]Directories to ignore during scanning. Default:
["vendor", "tests"]Default output format:
md, json, txt, or htmlGenerate simplified reports without code snippets or suggestions
Issue categories to exclude from reports. Supports presets (
unused, undefined, pocketmine) or individual categories.Analyzers to disable during analysis.Available analyzers:
PluginYmlMainClassPhpFileEventHandlerListenerCommandPermissionAsyncTaskSchedulerConfigResourceDeprecatedApiThreadSafetyPHPStan
Severity levels to exclude from reports. Valid values:
error, warning, info, hintEnable or disable specific analysis rules. Each rule can be set to
true or false.PHP Standard Rules:undefinedVariableundefinedMethodundefinedClassundefinedConstantundefinedFunctiontypeMismatchunusedVariableunusedParameterunusedImportdeadCode
invalidEventHandlerunregisteredListenerinvalidPluginYmlmainClassMismatchinvalidApiVersiondeprecatedApiUsageasyncTaskMisuseschedulerMisuseconfigMisusepermissionMismatchcommandMismatchresourceMissinginvalidEventPrioritycancelledEventAccessthreadSafetyViolation
Specific error codes to ignore
PHPStan baseline file path for gradual adoption
Examples
Next steps
After creating the configuration file:- Customize the settings in
retina.ymlto match your project needs - Run
retina runto perform analysis using your configuration - Adjust rules and filters based on the results
CLI options passed to
retina run will override settings from retina.yml.