fnando / vscode-linter

Extension for code linting, all in one package. New linters can be easily added through an extension framework.
https://marketplace.visualstudio.com/items?itemName=fnando.linter
MIT License
62 stars 16 forks source link

No linters found for "dockercompose" #28

Open gbomacfly opened 1 year ago

gbomacfly commented 1 year ago

Hi,

I'm using vscode-linter to lint my yaml and docker-compose.yml (which is yaml) files. Since I have also the "composer" extension for docker, the Language id changed from yaml to dockercompose. and yamllint don't recognize this.

It works if I run yamllint manually: yamllint -c ~/.yamllint.yml docker-compose.yml

Output in vscode:

Language id: dockercompose
No linters found for "dockercompose"

settings.json:

"linter.linters": {
    "yamllint": {
      "capabilities": [
        "ignore-line"
      ],
      "command": [
        "yamllint",
        "--format",
        "parsable",
        [
          "$config",
          "--config-file",
          "$config"
        ],
        "-"
      ],
      "configFiles": [
        ".yamllint.yml",
        ".yamllint.yaml",
        ".yamllint"
      ],
      "enabled": true,
      "languages": [
        "yaml",
      ],
      "name": "yamllint",
      "url": "https://github.com/adrienverge/yamllint"
    }
  },

I have added dockercompose to languages, but no result:

"languages": [
        "yaml",
        "dockercompose"
      ],

I also added a complete new section, with language only set to dockercompose, no luck...

"linter.linters": {
    "yamllint": {
      "capabilities": [
        "ignore-line"
      ],
      "command": [
        "yamllint",
        "--format",
        "parsable",
        [
          "$config",
          "--config-file",
          "$config"
        ],
        "-"
      ],
      "configFiles": [
        ".yamllint.yml",
        ".yamllint.yaml",
        ".yamllint"
      ],
      "enabled": true,
      "languages": [
        "yaml",
      ],
      "name": "yamllint",
      "url": "https://github.com/adrienverge/yamllint"
    },
    "yamllint_dockercompose": {
      "capabilities": [
        "ignore-line"
      ],
      "command": [
        "yamllint",
        "--format",
        "parsable",
        [
          "$config",
          "--config-file",
          "$config"
        ],
        "-"
      ],
      "configFiles": [
        ".yamllint.yml",
        ".yamllint.yaml",
        ".yamllint"
      ],
      "enabled": true,
      "languages": [
        "dockercompose"
      ],
      "name": "yamllint_dockercompose",
      "url": "https://github.com/adrienverge/yamllint"
    }
  },

What can I do here? Do i something wrong?

Thanks for help :)

gbomacfly commented 1 year ago

The first options just works fine after a vscode restart...

Thanks anyway :)