1

我不知道如何在 Arcanist(特别是 YAML)中进行自定义 linting pre-diff。这些说明没有解释如何将新的 linter 集成到我现有的.arclint配置中。

4

1 回答 1

1

我自己解决了这个问题,并认为我会在这里分享,以防其他人遇到这个问题。

以下.arclint文件可以解决问题:

{
  "linters": {
    "yaml": {
      "type": "script-and-regex",
      "script-and-regex.script": "yamllint",
      "script-and-regex.regex": "/^(?P<line>\\d+):(?P<offset>\\d+) +(?P<severity>warning|error) +(?P<message>.*) +\\((?P<name>.*)\\)$/m",
      "include": "(\\.yml$)",
      "exclude": [ ]
    }
  }
}

我还没有广泛尝试过那个正则表达式,但到目前为止它适用于我的目的。

您可以通过在存储库根目录中填充文件来配置 Yamllint 。.yamllint

于 2018-11-28T20:43:45.897 回答