我正在运行linux.我可以执行类似的操作pylint --generate-rcfile > .pylintrc
,然后对生成的.pylintrc
文件进行更改以覆盖默认设置吗?如果是这样,它应该在我的~/
目录中,还是应该放在.pylint.d中?
sth*_*ult 119
你可以把它放进去:
/etc/pylintrc
用于默认全局配置~/.pylintrc
用于默认用户配置<your project>/pylintrc
用于默认项目配置(在运行时使用pylint <your project>
)pylint --rcfile=<wherever I want>
另外请注意,在生成rc文件时,您可以在命令行之前添加选项--generate-rcfile
,它们将在生成的文件中被考虑.
jdh*_*hao 44
根据此处的文档,我们可以使用以下命令生成一个包含其所有选项的pylint rc文件:
pylint --generate-rcfile > ~/.pylintrc
Run Code Online (Sandbox Code Playgroud)
上面的命令将.pylintrc
在您的主目录下创建该文件.然后,您可以调整rc文件以满足您的需求.
有一个“新的实验功能”可以交互式地生成 .pylintrc 文件。
pylint-config generate --interactive
Please choose the format of configuration, (T)oml or (I)ni (.cfg): T
Do you want a minimal configuration without comments or default values? (y)es or (n)o: n
Do you want to write the output to a file? (y)es or (n)o: y
What should the file be called: .pylintrc
Wrote configuration file to ~/.pylintrc
Run Code Online (Sandbox Code Playgroud)
据我在文档中所知,没有明显的方法来选择配置文件,因此最好~/
按照之前的建议将其放入。
希望有帮助!
归档时间: |
|
查看次数: |
61226 次 |
最近记录: |