4

这是我跑步时所说的arc linters --verbose

AVAILABLE   csharp (C#)

Configuration Options

severity (optional map<string|int, string>)
  Provide a map from lint codes to adjusted severity levels: error,
  warning, advice, autofix or disabled.

severity.rules (optional map<string, string>)
  Provide a map of regular expressions to severity levels. All matching
  codes have their severity adjusted.

discovery (map<string, list<string>>)
  Provide a discovery map.

binary (string)
  Override default binary.

什么是发现地图?它不会告诉你它是什么,但你必须拥有它。不幸的是,源代码并没有启发我。

二进制...我不想覆盖默认二进制...什么是默认二进制?我必须覆盖它,所以我需要一个?我在哪里可以获得与 Arcanist 兼容的 C# linter 二进制文件?我能找到的唯一一个是https://github.com/hach-que/cstools,但它会引发异常。

让我知道我是否可以添加更多信息。

4

1 回答 1

2

cstools 是您需要的;如果您查看 ArcanistCSharpLinter.php,您可以看到这一点,它在其中查找 cslint.exe 作为默认二进制文件。

- - 编辑 - -

不确定您是否正在寻找正确的工具;所指的是这个由hach-que开发的,这里: https ://github.com/hach-que/cstools

我对这个 linter 不是很熟悉(我自己不做任何严肃的 C# 开发),但是快速浏览一下源代码表明发现映射只是一个称为“发现”的字符串映射,它具有设置短绒。

另见:https ://github.com/hach-que/cstools/issues/1

在此处复制粘贴示例,因为这似乎是 SO 政策:

示例 .arcconfig:

{
    "project_id": "Tychaia",
    "conduit_uri": "https://code.redpointsoftware.com.au/",
    "arc.autostash": true,
    "load": [
        "Build/Arcanist"
    ],
    "unit.engine": "XUnitTestEngine",
    "unit.csharp.xunit.binary": "packages/xunit.runners.1.9.1/tools/xunit.console.clr4.exe",
    "unit.csharp.cscover.binary": "cstools/cscover/bin/Debug/cscover.exe",
    "unit.csharp.coverage.match": "/^Tychaia.*\\.(dll|exe)$/",
    "unit.csharp.discovery": {
      "([^/]+)/(.*?)\\.cs": [
        [ "$1.Tests/$1.Tests.Linux.csproj", "$1.Tests/bin/Debug/$1.Tests.dll" ],
        [ "$1.Tests/$1.Tests.Windows.csproj", "$1.Tests/bin/Debug/$1.Tests.dll" ]
      ],
      "([^\\\\]+)\\\\(.*?)\\.cs": [
        [ "$1.Tests\\$1.Tests.Windows.csproj", "$1.Tests\\bin\\Debug\\$1.Tests.dll" ]
      ],
      "([^/]+)\\.Tests/(.*?)\\.cs": [
        [ "$1.Tests/$1.Tests.Linux.csproj", "$1.Tests/bin/Debug/$1.Tests.dll" ],
        [ "$1.Tests/$1.Tests.Windows.csproj", "$1.Tests/bin/Debug/$1.Tests.dll" ]
      ],
      "([^\\\\]+)\\.Tests\\\\(.*?)\\.cs": [
        [ "$1.Tests\\$1.Tests.Windows.csproj", "$1.Tests\\bin\\Debug\\$1.Tests.dll" ]
      ]
    }
}

示例 .arclint:

{
  "linters": {
    "csharp": {
      "type": "csharp",
      "include": "(\\.cs$)",
      "exclude": [ "(\\.Designer\\.cs$)", "(Phabricator\\.Conduit(.*+))", "(TychaiaProfilerEntityUtil\\.cs)" ],
      "binary": "cstools/cslint/bin/Debug/cslint.exe",
      "discovery": {
        "([^/]+)/(.*?)\\.cs": [
          "$1/$1.Linux.csproj"
        ],
        "([^\\\\]+)\\\\(.*?)\\.cs": [
          "$1\\$1.Windows.csproj"
        ]
      }
    },
    "license": {
      "type": "tychaialicense",
      "include": "(\\.cs$)",
      "exclude": [ "(\\.Designer\\.cs$)", "(Phabricator\\.Conduit(.*+))", "(TychaiaProfilerEntityUtil\\.cs)" ]
    }
  }
}

无论如何,如果您无法让 cstools 正常工作,我建议您在 Github 存储库上打开一个问题;他似乎反应灵敏。另外,作为一名开源开发人员,听到其他人在使用您的工作总是很高兴。

于 2015-02-04T12:45:03.173 回答