我试图在项目中添加pinterest-linter,但是当我arc lint
时遇到一些错误。
ARGV '/Users/lushali/somewhere/arcanist/bin/../scripts/arcanist.php' 'lint' '--trace'
LOAD Loaded "phutil" from "/Users/lushali/somewhere/libphutil/src".
LOAD Loaded "arcanist" from "/Users/lushali/somewhere/arcanist/src".
Config: Reading user configuration file "/Users/lushali/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/Users/lushali/code/nexus_admin/.arcconfig".
Working Copy: Path "/Users/lushali/code/nexus_admin" is part of `git` working copy "/Users/lushali/code/nexus_admin".
Working Copy: Project root is at "/Users/lushali/code/nexus_admin".
Config: Did not find local configuration at "/Users/lushali/code/nexus_admin/.git/arc/config".
Loading phutil library from 'pinterest-linters'...
>>> [0] (+0) <exec> $ git rev-parse --verify HEAD^
<<< [0] (+10) <exec> 10,455 us
>>> [1] (+10) <exec> $ git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}'
<<< [1] (+20) <exec> 9,782 us
>>> [2] (+20) <exec> $ git cat-file -t 'origin/master'
<<< [2] (+34) <exec> 13,470 us
>>> [3] (+34) <exec> $ git merge-base 'origin/master' HEAD
<<< [3] (+46) <exec> 11,523 us
>>> [4] (+46) <exec> $ git diff --no-ext-diff --no-textconv --submodule=short --raw '1bba3081e23c945b3f795eedc73b99e3f509b5ed' HEAD --
<<< [4] (+59) <exec> 12,633 us
>>> [5] (+59) <exec> $ git --version
<<< [5] (+71) <exec> 11,867 us
>>> [6] (+71) <exec> $ git status --porcelain=2 -z
<<< [6] (+88) <exec> 16,486 us
>>> [7] (+88) <exec> $ git diff --no-ext-diff --no-textconv --submodule=short --no-color --src-prefix=a/ --dst-prefix=b/ -U32767 -M -C '1bba3081e23c945b3f795eedc73b99e3f509b5ed' --
<<< [7] (+120) <exec> 31,626 us
Examining paths for linter 'spelling'.
Found 6 matching paths for linter 'spelling'.
Examining paths for linter 'generated'.
Found 6 matching paths for linter 'generated'.
Examining paths for linter 'merge-conflict'.
Found 6 matching paths for linter 'merge-conflict'.
Examining paths for linter 'general-text'.
Found 4 matching paths for linter 'general-text'.
Examining paths for linter 'json'.
Found 4 matching paths for linter 'json'.
[2019-06-03 22:05:07] EXCEPTION: (PhutilProxyException) Error in parsing '.arclint' file, in key 'bin' for linter 'prettier-eslint'. {>} (Exception) None of the configured binaries can be located. at [<arcanist>/src/lint/linter/ArcanistExternalLinter.php:543]
arcanist(head=master, ref.master=7329bc7c32b9), phutil(head=master, ref.master=86ee6e90797c), pinterest-linters(head=master, ref.master=3628e14b6f57)
#0 <#2> ArcanistExternalLinter::setLinterConfigurationValue(string, string) called at [<pinterest-linters>/src/PrettierESLintLinter.php:114]
#1 <#2> PrettierESLintLinter::setLinterConfigurationValue(string, string) called at [<arcanist>/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php:103]
#2 ArcanistConfigurationDrivenLintEngine::buildLinters() called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:166]
#3 ArcanistLintEngine::run() called at [<arcanist>/src/workflow/ArcanistLintWorkflow.php:337]
#4 ArcanistLintWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394]
我正在按照github(https://github.com/pinterest/arcanist-linters#global-installation)上的说明进行操作
这是我的.arcconfig
文件:
{
"phabricator.uri" : "https://code.XXXXX.com/",
"load": [
"pinterest-linters"
]
}
我在.bin/prettier-eslint
文件夹中找不到node_modules
。我认为Arcanist加载模块时可能出了点问题。我花了大量时间在网上搜索,但没有任何用处。有人可以帮忙吗?非常感谢!
答案 0 :(得分:0)
根据您的错误消息,我认为您需要在将.arclint
添加到pinterest-linters
文件的基础上创建一个.arcconfig
文件。例如,用于.arclint
和prettier
的{{1}}文件看起来像这样:
eslint
但是,您的消息可能有所不同,因为错误消息指出您使用{
"linters": {
"eslint": {
"type": "eslint",
"include": ["(\\.js$)", "(\\.jsx$)"],
"bin": "./node_modules/.bin/eslint",
"eslint.config": ".eslintrc",
"eslint.env": "browser,node"
},
"prettier": {
"type": "prettier",
"include": ["(\\.js$)", "(\\.jsx$)"],
"bin": "./node_modules/.bin/prettier",
"prettier.cwd": "./"
}
}
}
。