PhpStorm 2021.2 Help

Code Inspections in YAML

This topic lists all PhpStorm code inspections available in YAML.

You can toggle specific inspections or change their severity level on the Editor | Inspections page of the IDE settings Ctrl+Alt+S.

Inspection

Description

Default Severity

Deprecated YAML key

Reports deprecated keys in YAML files.

Deprecation is checked only if there exists a JSON schema associated with the corresponding YAML file.

Note that the deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard deprecationMessage extension.

Scheme deprecation example:

{ "properties": { "SomeDeprecatedProperty": { "deprecationMessage": "Baz", "description": "Foo bar" } } }


The following is an example with the corresponding warning:
SomeDeprecatedProperty: some value

Weak Warning Weak warning

Duplicated YAML keys

Reports duplicated keys in YAML files.

Example:

same_key: some value same_key: another value

Error Error

Recursive alias

Reports recursion in YAML aliases.

Alias can't be recursive and be used inside the data referenced by a corresponding anchor.

Example:

some_key: &some_anchor sub_key1: value1 sub_key2: *some_anchor

Error Error

Unresolved alias

Reports unresolved aliases in YAML files.

Example:

some_key: *unknown_alias

Error Error

Unused anchor

Reports unused anchors.

Example:

some_key: &some_anchor key1: value1

Warning Warning

Validation by JSON Schema

Reports inconsistencies between a YAML file and a JSON Schema if the schema is specified.

Scheme example:

{ "properties": { "SomeNumberProperty": { "type": "number" } } }


The following is an example with the corresponding warning:
SomeNumberProperty: hello world

Warning Warning

Last modified: 16 July 2021