对于 Pylint,是否可以为每个 Eclipse 项目使用不同的 pylintrc 文件? [英] For Pylint, is it possible to have a different pylintrc file for each Eclipse project?

查看:41
本文介绍了对于 Pylint,是否可以为每个 Eclipse 项目使用不同的 pylintrc 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到我可以使用 this 解决方案对每个 Eclipse 实例进行更改.我想为每个项目设置它.可能吗?

解决方案

这不是 Eclipse 特定的,但无论如何它可能会有所帮助.根据 pylint 命令行选项:><块引用>

您可以使用 --rcfile 选项在命令行上指定配置文件.否则,Pylint 按以下顺序搜索配置文件并使用它找到的第一个:

  1. pylintrc 在当前工作目录中
  2. .pylintrc 在当前工作目录中
  3. 如果当前工作目录在 Python 模块中,Pylint 会向上搜索 Python 模块的层次结构,直到找到 pylintrc 文件.这允许您逐个模块地指定编码标准.当然,如果目录中包含__init__.py文件,则判断为Python模块.
  4. 环境变量命名的文件PYLINTRC
  5. 如果您的主目录不是 /root:

    1. .pylintrc 在您的主目录中
    2. .config/pylintrc 在您的主目录中

  6. /etc/pylintrc

上面的第 1 点或第 3 点可能会有所帮助.

I saw I can change it per Eclipse instance using this solution. I would like to set it per project. Is it possible?

解决方案

This is not Eclipse specific, but it may help anyway. According to pylint command line options:

You can specify a configuration file on the command line using the --rcfile option. Otherwise, Pylint searches for a configuration file in the following order and uses the first one it finds:

  1. pylintrc in the current working directory
  2. .pylintrc in the current working directory
  3. If the current working directory is in a Python module, Pylint searches up the hierarchy of Python modules until it finds a pylintrc file. This allows you to specify coding standards on a module-by-module basis. Of course, a directory is judged to be a Python module if it contains an __init__.py file.
  4. The file named by environment variable PYLINTRC
  5. If you have a home directory which isn’t /root:

    1. .pylintrc in your home directory
    2. .config/pylintrc in your home directory

  6. /etc/pylintrc

Points 1 or 3 above may help.

这篇关于对于 Pylint,是否可以为每个 Eclipse 项目使用不同的 pylintrc 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆