-
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Open
yamllint: ignore rule in config file doesn't work#39
Description
I've created some ignore rule in .yamllint.yaml like the following
rules:
indentation:
ignore:
- "base/templates/deployment.yaml"
indentation:
ignore:
- "base/templates/deployment.yaml"
When I run yamllint from the command line all works fine.
But in VS-Code I still get a line to long error.
After some experimentation I stumbled about this in .settings
"yamllint": {
"capabilities": ["ignore-line"],
"command": [
"yamllint",
"--format",
"parsable",
["$config", "--config-file", "$config"],
"-"
],
...
"capabilities": ["ignore-line"],
"command": [
"yamllint",
"--format",
"parsable",
["$config", "--config-file", "$config"],
"-"
],
...
which means, yamllint reads the file from stdin and obvious has no filename.
I can get around this problem by calling yamllint with the filename
"yamllint": {
"capabilities": ["ignore-line"],
"command": [
"yamllint",
"--format",
"parsable",
["$config", "--config-file", "$config"],
"$file" # <-- change!
],
...
"capabilities": ["ignore-line"],
"command": [
"yamllint",
"--format",
"parsable",
["$config", "--config-file", "$config"],
"$file" # <-- change!
],
...
but I have to re-write the ignore rules to
rules:
indentation:
ignore:
- "**/base/templates/deployment.yaml"
indentation:
ignore:
- "**/base/templates/deployment.yaml"
because it seems, that yamllint is not executed from the root of the workspace.
After these changes my yaml files are linted as they were linted from the command line.
Is there anything that I miss, or is there a better way to tackle this problem?
Metadata
Metadata
Assignees
Labels
No labels