我在我的Python项目中使用吉特皮棉。
我的git根目录中有一个.gitlint.yaml文件,其中包括:
pylint:
extensions:
- .py
command: pylint
arguments:
- "--rcfile={DEFAULT_CONFIGS}/.pylintrc" # doesn't seem to work
- "--disable=all" # doesn't work either
- "--output-format=text"
- "--msg-template='{{abspath}}:{{line}}:{{column}}: [{{category}}:{{symbol}}] {{obj}}: {{msg}}'"
- "--reports=n"
filter: "^{filename}:(?P<line>{lines}):((?P<column>\\d+):)? \\[(?P<severity>.+):(?P<message_id>\\S+)\\]\\s+(: )?(?P<message>.+)$"
installation: "Run pip install pylint."我甚至创建了一个~/.config/pylintrc文件,其中包括
indent-string=\t但是当我运行git lint时,没有禁用警告,尤其是line 41, col 0: Warning: [mixed-indentation]: Found indentation with tabs instead of spaces警告。
我已经得出结论(并验证了),~/.config/pylintrc文件根本没有被处理。
为什么pylint忽略所有配置选项?我可以采取哪些故障排除步骤?我最好的猜测是,当由git lint执行时,pylint是由我以外的其他用户运行的。
发布于 2017-01-01 06:30:55
我在test/unittest/test_gitlint.py上看到了
self.root = '/home/user/repo'
git_config = os.path.join(self.root, '.gitlint.yaml')所以你的配置应该在正确的位置。
但是,检查是否有缓存问题(/home/user/.git-lint/cache),如第34期中提到的。
如果
.gitlint.yaml是在写缓存后更新的,则输出缓存应该无效。 否则,您可以编辑配置,以例如忽略错误类型,但它将仍然存在时,重新运行。
发布于 2019-02-20 19:34:19
我遇到了同样的问题。我的解决方法是删除.gitlint.yaml文件中的rcfile参数行。
然后,基于皮林特是如何寻找它的获取正确的on文件。此外,我还需要使用以下内容删除缓存目录:
rm -r ~/.git-lint/cachehttps://stackoverflow.com/questions/41390925
复制相似问题