happylinks / gqlint

GraphQL (Schema) Linter
MIT License
41 stars 4 forks source link

List of possible linter "security keys" or log level #16

Closed tkolleh closed 4 years ago

tkolleh commented 4 years ago

What are the different log levels printed by gqlint?

TL:DR; Regex capture errors, warnings, etc... then map to language server plugin equivalent.

I intend to describe gqlint in the coc-settings.json file for the coc-diagnostic plug. There a field asks for possible securities to capture linter output severity for the diagnostic plugin.

(view provided regex)

  "diagnostic-languageserver.linters": {
    "gqlint": {
      "command": "gqlint",
      "debounce": 100,
      "offsetLine": 0,
      "offsetColumn": 1,
      "sourceName": "gqlint",
      "formatLines": 1,
      "formatPattern": [
        "^\\s+(\\d+):(\\d+)\\s+(\\w+)\\s+(\\w+)\\s+(.+)$",
        {
          "line": 1,
          "column": 2,
          "endLine": 1,
          "endColumn": 2,
          "message": 5,
          "security": 3
        }
      ],
      "securities": {
        "error": "error",
        "warning": "warning",
        "note": "info"
      }
    }
  },
happylinks commented 4 years ago

Hey there, sorry I missed this issue. gqlint outputs two types of errors:

"warn" or 1 - turn the rule on as a warning (doesn't affect exit code)
"error" or 2 - turn the rule on as an error (exit code will be 1)

Hope that helps!

tkolleh commented 4 years ago

Thanks for the response. I've moved to a graphql LSP.