我正在为我的 Python 项目使用git-lint。
.gitlint.yaml
我的 git repo 的根目录中有一个文件,其中包含,除其他外,
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 是由我以外的某个用户运行的。