Odoo的Pylint插件
项目描述
Pylint Odoo插件
启用Odoo模块的自定义检查。
| 简称 | 描述 | 代码 |
|---|---|---|
| attribute-deprecated | attribute "%s" deprecated | W8105 |
| attribute-string-redundant | 属性字符串是多余的。字符串参数等于变量的名称 | W8113 |
| bad-builtin-groupby | 使用了内置函数 itertools.groupby。建议使用 odoo.tools.groupby。更多关于 https://github.com/odoo/odoo/issues/105376 的信息 |
W8155 |
| category-allowed | Category "%s" 在清单文件中不允许。 | C8114 |
| 考虑合并继承的类 | 考虑合并从%s继承到"%s"的类。 | R8180 |
| 上下文覆盖 | 使用dict覆盖上下文。更好的方法是使用kwargs with_context(**%s) 或 with_context(key=value) |
W8121 |
| 废弃的Odoo模型方法 | %s已被Odoo废弃。请寻找替代方案。 | W8160 |
| 开发状态允许 | Manifest键开发状态"%s"不允许。请使用以下之一:%s。 | C8111 |
| except-pass | 将pass传递给except块。如果您确实需要使用pass,请考虑记录该异常。 | W8138 |
| 外部请求超时 | 未设置超时的外部请求方法 %s。它可能需要等待很长时间。 |
E8106 |
| 无效提交 | 直接使用cr.commit() - 更多信息 https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#never-commit-the-transaction | E8102 |
| 许可允许 | 在manifest文件中不允许使用"%s"许可。 | C8105 |
| manifest-author-string | manifest文件中的作者键必须是字符串(以逗号分隔的值) | E8101 |
| manifest-behind-migrations | manifest版本(%s)低于迁移脚本(%s) | E8145 |
| manifest-data-duplicated | 文件"%s"在manifest键"%s"的行%s中重复。 | W8125 |
| manifest-deprecated-key | manifest文件中的已弃用键"%s"。 | C8103 |
| manifest-maintainers-list | manifest文件中的维护者键必须是一组字符串列表。 | E8104 |
| manifest-required-author | 以下作者之一必须在manifest中存在:%s | C8101 |
| manifest-required-key | 在manifest文件中缺少必需的键"%s"。 | C8102 |
| manifest-version-format | manifest文件中的版本格式"%s"错误。匹配的正则表达式:%s | C8106 |
| method-compute | compute方法名称应以"compute"开头 | C8108 |
| method-inverse | inverse方法名称应以"inverse"开头 | C8110 |
| method-required-super | 在"%s"方法中缺少super调用。 |
W8106 |
| method-search | search方法名称应以"search"开头 | C8109 |
| missing-readme | 缺少./README.rst文件。模板在此:%s | C8112 |
| missing-return | 在方法%s中缺少return(使用了super)。 |
W8110 |
| no-raise-unlink | unlink()函数内部不应抛出异常 | E8140 |
| no-wizard-in-models | 模型目录中没有wizard类。请参阅完整的结构 https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#complete-structure | C8113 |
| no-write-in-compute | Compute方法调用write。请使用update代替。 |
E8135 |
| odoo-addons-relative-import | 相同的Odoo模块绝对导入。您应使用相对导入".%s"而不是"odoo.addons.%s" | W8150 |
| odoo-exception-warning | odoo.exceptions.Warning是odoo.exceptions.UserError的已弃用别名。请使用from odoo.exceptions import UserError |
R8101 |
| print-used | 使用Print。请使用logger代替。 |
W8116 |
| prohibited-method-override | 禁止覆盖"%s"方法。 | W8107 |
| renamed-field-parameter | 字段参数"%s"不再受支持。请使用"%s"代替。 | W8111 |
| resource-not-exist | 文件"%s":"%s"未找到。 | F8101 |
| sql-injection | SQL注入风险。如果可能,请使用参数。 - 更多信息 https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#no-sql-injection | E8103 |
| test-folder-imported | 模块%s中导入了测试文件夹。 | E8130 |
| translation-contains-variable | 可翻译术语在"%s"中包含变量。请使用%s代替 | W8115 |
| 翻译字段 | 字段中的翻译方法 _("字符串") 不是必需的。 | W8103 |
| 翻译格式插值 | 在 odoo._ 函数中使用 %s 格式化 | W8302 |
| 翻译格式截断 | 日志格式字符串在转换指定符中间结束 | E8301 |
| 翻译 f-string 插值 | 在 odoo._ 函数中使用 %s 格式化 | W8303 |
| 翻译非延迟 | 在 odoo._ 函数中使用 %s 格式化 | W8301 |
| 位置参数使用 | 翻译方法 _(%s) 使用了位置字符串 printf 格式化。请使用命名占位符 _("%%(占位符)s")。 |
W8120 |
| 翻译必需 | "%s" 上的字符串参数需要翻译。使用 %s_(%s) | C8107 |
| 参数不足 | odoo._ 格式字符串参数不足 | E8306 |
| 参数过多 | odoo._ 格式字符串参数过多 | E8305 |
| 不支持的格式 | 在索引 %d 处不支持 odoo._ 格式字符 %r (%#02x) | E8300 |
| 使用-vim-comment | 使用 vim 注释 | W8202 |
| 网站清单键无效 URI | 清单键中的网站 "%s" 不是一个有效的 URI | W8114 |
安装
如果您使用 pre-commit-config,则无需手动安装。
但如果您甚至需要安装它
pip install pylint-odoo
使用 pre-commit-config.yaml
将以下输入添加到您的 ".pre-commit-config.yaml" 配置文件中
- repo: https://github.com/OCA/pylint-odoo
rev: v9.1.2 # may be a tag or commit hash
hooks:
# Add to your .pylintrc file:
# [MASTER]
# load-plugins=pylint_odoo
- id: pylint_odoo
用法
pylint --load-plugins=pylint_odoo -e odoolint path/to/test
或使用配置文件,您可以使用以下模板存储库生成 OCA 之一
https://github.com/OCA/oca-addons-repo-template
然后运行
pylint --rcfile=.pylintrc path/to/test
仅测试 pylint_odoo 检查的示例
pylint --load-plugins=pylint_odoo -d all -e odoolint {ADDONS-PATH}/*
只有特定 Odoo 版本才有效的检查。要了解您正在运行哪个版本的 odoo,pylint 需要参数
pylint --load-plugins=pylint_odoo --valid-odoo-versions={YOUR_ODOO_VERSION}
具有特定 odoo 版本,例如 "16.0"
仅对 odoo >= 14.0 有效的检查
translation-format-interpolation
translation-format-truncated
translation-fstring-interpolation
translation-not-lazy
translation-too-few-args
translation-too-many-args
translation-unsupported-format
仅对 odoo <= 13.0 有效的检查
translation-contains-variable
示例
-
attribute-deprecated
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L105 属性 "_columns" 已弃用
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L106 属性 "_defaults" 已弃用
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L107 属性 "length" 已弃用
-
attribute-string-redundant
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L161 属性字符串是冗余的。字符串参数等于变量的名称
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L209 属性字符串是冗余的。字符串参数等于变量的名称
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L219 属性字符串是冗余的。字符串参数等于变量的名称
-
bad-builtin-groupby
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L110 使用了内置函数
itertools.groupby。建议使用odoo.tools.groupby。有关更多信息,请参阅 https://github.com/odoo/odoo/issues/105376 - https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L111 使用了内置函数
itertools.groupby。建议使用odoo.tools.groupby。有关更多信息,请参阅 https://github.com/odoo/odoo/issues/105376
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L110 使用了内置函数
-
考虑合并继承的类
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/model_inhe2.py#L11 考虑合并从 testing/resources/test_repo/broken_module/models/model_inhe1.py:8:4 和 testing/resources/test_repo/broken_module/models/model_inhe2.py:7:4 继承到 "res.company" 的类。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/model_inhe2.py#L19 考虑将继承自 "res.partner" 的类合并到 testing/resources/test_repo/broken_module/models/model_inhe2.py:15:4。
-
上下文覆盖
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L192 使用字典覆盖上下文。最好使用
with_context(**{'overwrite_context': True})或with_context(key=value) - https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L194 使用字典覆盖上下文。最好使用
with_context(**ctx)或with_context(key=value) - https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L196 使用字典覆盖上下文。最好使用
with_context(**ctx2)或with_context(key=value)
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L192 使用字典覆盖上下文。最好使用
-
废弃的Odoo模型方法
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L91 Odoo 已经弃用 fields_view_get。请寻找替代方案。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/eleven_module/models.py#L17 Odoo 已经弃用 fields_view_get。请寻找替代方案。
-
开发状态允许
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module2/__openerp__.py#L6 Manifest 键 development_status "InvalidDevStatus" 不允许。请使用以下之一:Alpha、Beta、Mature、Production/Stable。
-
except-pass
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/test_module/except_pass.py#L11 在 except 块中使用 pass。如果确实需要使用 pass,请考虑记录该异常
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/test_module/except_pass.py#L53 在 except 块中使用 pass。如果确实需要使用 pass,请考虑记录该异常
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/test_module/except_pass.py#L62 在 except 块中使用 pass。如果确实需要使用 pass,请考虑记录该异常
-
外部请求超时
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L685 在没有超时的情况下使用外部请求方法
requests.delete。它可能会等待很长时间 - https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L686 在没有超时的情况下使用外部请求方法
requests.get。它可能会等待很长时间 - https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L687 在没有超时的情况下使用外部请求方法
requests.head。它可能会等待很长时间
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L685 在没有超时的情况下使用外部请求方法
-
无效提交
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L404 直接使用 cr.commit() - 更多信息 https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#never-commit-the-transaction
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L405 直接使用 cr.commit() - 更多信息 https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#never-commit-the-transaction
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L406 直接使用 cr.commit() - 更多信息 https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#never-commit-the-transaction
-
许可允许
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module2/__openerp__.py#L4 清单文件中不允许出现“unknow license”许可。
-
manifest-author-string
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module3/__openerp__.py#L5 清单文件中的作者键必须是一个字符串(用逗号分隔的值)。
-
manifest-behind-migrations
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module2/__openerp__.py#L2 清单版本(1.0)低于迁移脚本(2.0)。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/eleven_module/__manifest__.py#L1 清单版本(11.0.1.0.0)低于迁移脚本(11.0.1.0.1)。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/test_module/__openerp__.py#L2 清单版本(10.0.1.0.0)低于迁移脚本(11.0.1.0.0)。
-
manifest-data-duplicated
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/__openerp__.py#L18 文件“duplicated.xml”在清单键“data”中的行19重复。
-
manifest-deprecated-key
-
manifest-maintainers-list
-
manifest-required-author
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/__openerp__.py#L5 清单文件必须包含以下作者之一:'Odoo Community Association (OCA)'。
-
manifest-required-key
-
manifest-version-format
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/__openerp__.py#L8 清单文件中的版本格式错误“8_0.1.0.0”。匹配正则表达式:“(4.2|5.0|6.0|6.1|7.0|8.0|9.0|10.0|11.0|12.0|13.0|14.0|15.0|16.0|17.0).\d+.\d+.\d+$”。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module2/__openerp__.py#L8 清单文件中的版本格式错误“1.0”。匹配正则表达式:“(4.2|5.0|6.0|6.1|7.0|8.0|9.0|10.0|11.0|12.0|13.0|14.0|15.0|16.0|17.0).\d+.\d+.\d+$”。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module3/__openerp__.py#L8 清单文件中的版本格式错误“8.0.1.0.0foo”。匹配正则表达式:“(4.2|5.0|6.0|6.1|7.0|8.0|9.0|10.0|11.0|12.0|13.0|14.0|15.0|16.0|17.0).\d+.\d+.\d+$”。
-
method-compute
-
method-inverse
-
method-required-super
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/pylint_oca_broken.py#L40 在“copy”方法中缺少
super调用。 - https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/pylint_oca_broken.py#L44 在“create”方法中缺少
super调用。 - https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/pylint_oca_broken.py#L48 在“write”方法中缺少
super调用。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/pylint_oca_broken.py#L40 在“copy”方法中缺少
-
method-search
- 在此处,搜索方法的名称应该以 "search" 开头
-
missing-readme
-
missing-return
- 在此处,继承的方法 inherited_method 缺少
return语句(使用了super)
- 在此处,继承的方法 inherited_method 缺少
-
no-raise-unlink
-
no-wizard-in-models
-
no-write-in-compute
-
odoo-addons-relative-import
-
odoo-exception-warning
- 在此处,
odoo.exceptions.Warning是odoo.exceptions.UserError的已弃用别名,请使用from odoo.exceptions import UserError。 - 在此处,
odoo.exceptions.Warning是odoo.exceptions.UserError的已弃用别名,请使用from odoo.exceptions import UserError。 - 在此处,
odoo.exceptions.Warning是odoo.exceptions.UserError的已弃用别名,请使用from odoo.exceptions import UserError。
- 在此处,
-
print-used
- 在此处,使用了打印语句。请使用
logger代替。
- 在此处,使用了打印语句。请使用
-
renamed-field-parameter
- 在此处,字段参数 "digits_compute" 已不再受支持。请使用 "digits" 代替。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L209 字段参数 "select" 已不再支持。请使用 "index" 代替。
-
resource-not-exist
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/__openerp__.py#L14 文件 "data": "file_no_exist.xml" 未找到。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/__openerp__.py#L18 文件 "data": "duplicated.xml" 未找到。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/__openerp__.py#L23 文件 "demo": "file_no_exist.xml" 未找到。
-
sql-injection
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L571 存在 SQL 注入风险。如果可能,请使用参数。 - 更多信息 https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#no-sql-injection
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L573 存在 SQL 注入风险。如果可能,请使用参数。 - 更多信息 https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#no-sql-injection
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L575 存在 SQL 注入风险。如果可能,请使用参数。 - 更多信息 https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#no-sql-injection
-
test-folder-imported
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/__init__.py#L5 测试文件夹在模块 broken_module 中被导入
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module2/__init__.py#L3 测试文件夹在模块 broken_module2 中被导入
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/eleven_module/__init__.py#L3 测试文件夹在模块 eleven_module 中被导入
-
translation-contains-variable
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L371 在 "'Variable not translatable: %s' % variable1" 中的可翻译术语包含变量。请使用 _('Variable not translatable: %s') % variable1 代替
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L372 在 "'Variables not translatable: %s, %s' % (variable1, variable2)" 中的可翻译术语包含变量。请使用 _('Variables not translatable: %s, %s') % (variable1, variable2) 代替
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L374 在 "'Variable not translatable: %s' % variable1" 中的可翻译术语包含变量。请使用 _('Variable not translatable: %s') % variable1 代替
-
翻译字段
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L143 字段中使用翻译方法 _("string") 是不必要的。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L153 字段中使用的翻译方法 _("string") 是不必要的。
-
翻译格式插值
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L380 在 odoo._ 函数中使用惰性 % 或 .format() 或 % 格式化
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L381 在 odoo._ 函数中使用惰性 % 或 .format() 或 % 格式化
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L468 在 odoo._ 函数中使用惰性 % 或 .format() 或 % 格式化
-
翻译格式截断
-
翻译 f-string 插值
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L477 在 odoo._ 函数中使用惰性 % 或 .format() 或 % 格式化
-
翻译非延迟
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L345 在 odoo._ 函数中使用惰性 % 或 .format() 或 % 格式化
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L346 在 odoo._ 函数中使用惰性 % 或 .format() 或 % 格式化
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L348 在 odoo._ 函数中使用惰性 % 或 .format() 或 % 格式化
-
位置参数使用
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L372 翻译方法 _('Variables not translatable: %s, %s' % (variable1, variable2)) 使用了位置字符串 printf 格式化。请使用命名占位符
_("%(placeholder)s")代替。 - https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L375 翻译方法 _('Variables not translatable: %s %s' % (variable1, variable2)) 使用了位置字符串 printf 格式化。请使用命名占位符
_("%(placeholder)s")代替。 - https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L378 翻译方法 _('Variables not translatable: %s, %s' % (variable1, variable2)) 使用了位置字符串 printf 格式化。请使用命名占位符
_("%(placeholder)s")代替。
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L372 翻译方法 _('Variables not translatable: %s, %s' % (variable1, variable2)) 使用了位置字符串 printf 格式化。请使用命名占位符
-
翻译必需
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L322 "message_post" 的字符串参数需要翻译。请使用 body=_('Body not translatable %s')
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L322 "message_post" 的字符串参数需要翻译。请使用 subject=_('Subject not translatable')
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L324 "message_post" 的字符串参数需要翻译。请使用 body=_('Body not translatable {}')
-
参数不足
-
参数过多
-
不支持的格式
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module/models/broken_model.py#L478 不支持的 odoo._ 格式字符 'y' (0x79) 在索引 30
-
使用-vim-comment
-
网站清单键无效 URI
- https://github.com/OCA/pylint-odoo/blob/v9.1.2/testing/resources/test_repo/broken_module3/__openerp__.py#L7 清单键中的网站 "htt://odoo-community.com" 不是一个有效的 URI
开发
要运行所有测试,请运行
tox
使用额外参数来更改测试行为
例如,特定的 Python 版本
tox -e py310
例如,特定的 unittest 方法
tox -e py310 -- -k test_20_expected_errors
例如,并行同时运行所有测试
tox -p auto
许可证
此存储库受 AGPL-3.0 许可。
OCA,或 Odoo 社区协会,是一个非营利组织,其使命是支持 Odoo 功能的协作开发并推广其广泛应用。
变更
v9.1.2
- [引用] setup: 添加 py3.12 支持信息 (#490)
v9.1.1
- [引用] update-readme
- [添加] prohibited-method-override: 新的检查以避免覆盖方法 (#485)
- [引用] .github: 更新 actions 缓存和修复 pre-commit 缓存路径 (#489)
v9.1.0
- [引用] requirements: 更新软件包版本 (#488)
v9.0.6
- [引用] requirements: 与验证器 0.22 兼容
v9.0.5
- [修复] odoo-addons-relative-import: 排除迁移 (#481)
v9.0.4
- [引用] readme: 使用 'tox -e update-readme' 更新说明
v9.0.3
- [添加] manifest-behind-migrations: 检查清单版本 >= 迁移 (#475)
v9.0.2
- [引用] 添加对 Odoo v17.0 的支持 (#477)
v9.0.1
- [添加] category-allowed: 添加检查以强制执行允许的 Odoo 模块类别 (#459)
v9.0.0
- [引用]: 更新到 pylint 3.0.0,放弃对 py3.7 的支持 (#474)
v8.0.22
- [引用] setup.py: 从变更日志中过滤掉 "bump version" (#472)
v8.0.21
- [添加] deprecated-odoo-model-method: 新的检查以检测每个 Odoo 版本的已弃用方法 (#470)
- [引用] ci: 每个作业只运行一个 tox 环境 (#468)
v8.0.20
- [引用] tox: 再次构建 ChangeLog (#466)
- [添加] no-raise-unlink: 检查 unlink 方法中是否有 raise 语句 (#458)
- [修复] correct README pre-commit 使用 (#463)
v8.0.19
- [修复] pre-commit-vauxoo: 修复 isort 钩子 - RuntimeError The Poetry configuration is invalid (#456)
v8.0.18
- [修复] Readme: 新的 CLI 命令格式 --valid-odoo-version (#453)
- [引用] ci: 更新 gh actions .yml 和 tox.ini (#451)
- [修复] pre-commit-config: 更新 flake8 仓库 (#446)
v8.0.17
- [删除] 删除未使用的 eslintrc 文件
- [引用] tests: 使用 test_repo 中的示例自动生成说明 (#443)
- [引用] tox, pre-commit, readme: 小改动 (#443)
v8.0.16
- [添加] bad-builtin-groupby: 优先使用 `odoo.tools.groupby` (#442)
v8.0.15
- [修复] setup: 向包中添加缺失的 "requirements.txt" 文件 (#441)
v8.0.14
- [引用] no-wizard-in-models: 为 "res.config*" 继承类添加异常 (#439)
- [添加] no-wizard-in-models: 在模型目录中添加新检查以避免添加向导类 (#437)
v8.0.13
- [引用] consider-merging-classes-inherited: 改进带有 relpath + 列号的消息 (#436)
v8.0.12
- [修复] consider-merging-classes-inherited: 修复 TODO 考虑 _inherit 在 _name 分配之前的情况 (#435)
- [修复] custom_logging: 修复 AstroidSyntaxError 使用与 '%' 相关的唯一 binop (#434)
v8.0.11
- [引用] manifest-data-duplicated, resource-not-exist: 改进重复节点的行号 (lineno) (#433)
v8.0.10
- [修复] pylint_odoo: 使用 node.op 而不是硬编码 % (#432)
v8.0.9
- [修复] pylint_odoo: "ImportError: No module named 'packaging'" (#431)
- [参考] 读取文件:添加 PyPI 徽章的每月下载量 (#430)
- [参考] pylint_odoo:使用新的 typing astroid.nodes 代替 astroid.Class (#429)
v8.0.8
- [新增] no-write-in-compute:不要在计算字段上写入 (#427)
v8.0.7
- [参考] pylint_odoo:将选项名称从 "_" 替换为 "-" 因为 (#426)
v8.0.6
- [参考] README:自动更新 README (#425)
- [参考] pylint_odoo:处理 max_odoo_version 和 min_odoo_version 以进行检查 (#424)
- [新增] translation-*:添加与 "logging" 检查相同的 "odoo._" 翻译方法的 translation-* 检查 (#423)
- [参考] CI:启用 py3.11 (#420)
v8.0.5
- [参考] tox:启用来自环境列表的 lints (#418)
- [参考] setup:匹配 pylint 的 requires-python = ">=3.7.2" (#417)
- [参考] CI:启用 tox 与 parallels + codecov 兼容性 (#415)
- [参考] augmentations:使用消息代码而不是消息 ID 进行代码抑制 (#414)
v8.0.4
- [参考] README:使用 pylint_odoo.messages2md() 自动更新 (#413)
- [移除] class-camelcase:被 invalid-name 替换 (#413)
- [参考] tests:移除 'score' (#412)
- [参考] openerp-exception-warning:更改为 odoo-exception-warning (#411)
- [参考] pylint_odoo:对 utils.only_required_for_messages 进行排序 (#410)
- [改进] print-used:加速 'print-used' 检查以避免推断 (#409)
- [移除] eval-referenced:由 pylint 的 eval-used 检查替换 (#408)
- [参考] pylint_odoo:visit_dict - 使用字典键节点 (#407)
v8.0.3
- [参考] 更新 "visit_*" 方法可用性、代码顺序和值 (#406)
- [新增] missing-readme:再次添加 missing-readme (#405)
- [参考] pylint_odoo:清理代码 (#404)
- [参考] pylint_odoo:清理代码 (#402)
v8.0.2
- [参考] codecov, README:重新启用 codecov 并修复 README 中的 URL (#401)
v8.0.1
- [参考] 读取文件:从 RST 迁移到 MARKDOWN 格式 (#400)
- [参考] pylint_odoo:对 CI、lints、pytest 和代码进行小修改 (#399)
- [参考] requirements:更新 pylint 依赖项 (#398)
- [改进] pylint_odoo:black, isort, prettier (#397)
v8.0.0
- [改进] pylint_odoo:apocalintSYS - 完全重构 - v8.0.0 (#396)
7.0.4
- [参考] translation-positional-used:考虑 srt.format('{} {}') 的情况 (#395)
7.0.3
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [参考] CI:注释 py3.7 travis 中与错误无关的问题 (#393)
- [新增] manifest-data-duplicated:检测重复的数据文件 (#392)
7.0.2
- [修复] attribute-string-redundant:仅当字段字符串与 title() 格式相同 (#392)
7.0.1
- [参考] pylint_odoo:更新支持的 Odoo 版本 16.0 (#391)
- [参考] CI:使用 py3.10 和 3.11 环境进行 travis (#389)
- [参考] tests:添加 unittest 以检查仅启用一个检查 (#385)
7.0.0
- [参考] external-request-timeout:添加 ftplib.FTP 方法 (#388)
- 撤销 "[性能] *:仅当启用时运行检查 #372 (#376)" (#386)
- [性能] *:仅当启用时运行检查 #372 (#376)
- [修复] missing-import-error:将 xlrd 添加到白名单 (#379)
6.2.0
- [改进] duplicate-po-message-definition:仅通过 msgid 检测重复 (#374)
- [改进] test-folder-imported:考虑 'from . import test' 缺失的情况 (#373)
6.1.0
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [新增] external-request-timeout:它可能需要很长时间 (#370)
- [修复] .travis.yml:npm v18.0.0 与 travis 使用的 ubuntu 不兼容 (#371)
- [参考] README:使用新的 travis URL (#369)
6.0.0
- [新增] pre-commit-hooks:将 pylint_odoo 钩子添加到 pre-commit.yaml 中直接使用 (#368)
- [参考] requirements:将 pylint 包从 2.11.1 升级到 2.13.5 以支持 py3.x (#367)
- [修复] CI:修复 py3.7 上的 pluggy 错误并在单个构建中运行 lint (#366)
- [改进] sql-injection:检测使用 f-strings 时可能存在的 SQL 注入 (#364)
- [修复] Pinned lazy-object-proxy for Python 2.7 (#365)
- [修复] missing-return:对 tearDownClass 的检查不正确 (#362)
5.0.5
- [修复] OdooChecker:丢弃 migrations 文件夹作为 odoo 主模块 (#358)
5.0.4
- 撤销 "[撤销] requirements:使用 pylint<2.11.0 因为问题 5096 (#355)"
5.0.3
- [还原] 需求:使用pylint<2.11.0因为问题5096 (#355)
5.0.2
- [参考] 需求:升级pylint版本到2.11.1 (#354)
5.0.1
- [参考] manifest-version-format:添加新的有效odoo v15.0 (#353)
- [参考] sql-injection:使用常量不进行SQL注入 (#351)
- [修复] sql-injection:AttributeError: 'NoneType'对象没有属性'parent' (#350)
5.0.0
- [参考] 需求:升级pylint版本 (#349)
4.0.0
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [添加] dangerous-qweb-replace-wo-priority:考虑qweb视图模板 (#347)
- [添加] context-overridden:更好地使用kwargs而不是字典 (#256)
- [参考] invalid-name, unused-argument:抑制对迁移路径的检查 (#348)
3.10.0
- [修复] sql-injection:修复误报 (#344)
- [修复] pylint_odoo:修复manifest_version_format选项被忽略 (#346)
3.9.0
- [修复] translation-required:跳过测试文件夹 (#345)
- [修复] xml-syntax-error:修复XML有语法错误时的崩溃 (#343)
- [参考] pylint-odoo:添加.pylintrc示例 (#325)
- [修复] attribute-deprecated:仅检查"Model"类的属性 (#342)
- [修复] attribute-string-redundant: "string" of related field is taken from the referenced one (#341)
- [修复] file-not-used:修复Windows上的误报 (#335)
3.8.0
- [添加] Add pbr to requirements (#328)
- [参考] 需求:升级pylint版本 (#320)
3.7.1
- [修复] test-folder-imported:支持所有导入风格 (#315)
- [修复] misc.py:在检测odoo插件目录时,正确地支持python命名空间包 (#317)
3.7.0
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [添加] translation-positional-used:新的检查以验证是否允许更改字符串格式化顺序 (#305)
- [添加] str-format-used:检查翻译字符串中是否使用了str.format (#304)
- [添加] test-folder-imported:检查测试文件夹是否在init文件中导入 (#310)
3.6.0
- [修复] requirements:修复与pip 20.3断开的依赖关系,修复#306 (#313)
- [添加] add compatibility to v14.0 (#312)
3.5.1
- [参考] .travis.yml:启用部署pypi的条件 (#312)
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [修复] dangerous-view-replace-wo-priority:检查所有具有替换的子标签 (#309)
- [添加] pylint-odoo:添加新的检查,确保manifest中的维护者键必须是字符串列表 (#308)
- [参考] development-status-allowed:明确报告可能的值 (#301)
- [参考] odoo-addons-relative-import:在tests/目录中不适用 (#307)
- [参考] CI:启用py3.8和py3.9 (#294)
3.5.0
- [修复] messages2rst:与超过3个消息项兼容 (#292)
- [参考] no-utf8-coding-comment,unnecessary-utf8-coding-comment:使用python版本来启用/禁用它们 (#292)
- [参考] po-msgstr-variables:检查是否存在缺少'module:'注释 (#291)
3.4.0
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- 修复pragma: no cover位置
- [添加] po-msgstr-variables:检查翻译的字符串是否可以正确解析
- [添加] duplicate-po-message-definition, po-syntax-error:启用PO检查
3.3.2
- [参考] missing-manifest-dependency:将openupgradelib添加为白名单 (#288)
- [修复] sql-injection:考虑使用psycopg2.sql构建的有效参数 (#39)
3.3.1
- [参考] missing-import-error:为Odoo v13.0添加新包 (#40)
3.3.0
- [参考] requirements.txt:更新包版本 (#41)
3.2.0
- [修复] get_manifest_file:正确获取manifest文件 (#42)
- [修复] Visit module:管理odoo子目录。更好的方法来检查路径是否为odoo模块的子目录。之前,'/a/b/cc/d'被认为是指/a/b/c的子目录,因为'/a/b/c'在'/a/b/cc/d'中 == True
3.1.0
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [修复] rst_lint:默认使用UTF-8编码 (#44)
- [添加] 包名中包含点的情况
- [参考] .travis.yml:使用py3.7稳定版而不是开发版 (#46)
- 改进incoherent-interpreter-exec-perm消息
- 修复与isort配置文件的不兼容性
- [修复] rst-syntax-error:如果行None返回,则默认使用0 (#49)
3.0.3
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- 还原"[添加] method-default prefix" (#254)
3.0.2
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [参考] CI:修复flake8、测试和清理需求 (#51)
- [参考] pylint_odoo:支持odoo 13.0 (#52)
- [添加] method-default prefix (#53)
- [修复] .travis.yml:升级支持eslint的nvm版本 (#54)
- 允许控制台语句
- [添加] print-used:使用_logger而不是print (#56)
3.0.1
- [修复] AttributeError: 'MessagesStore' 对象没有 '_messages' 属性,相关问题请参考 https://github.com/PyCQA/pylint/commit/75cecdb1b88cc759223e83fd325aeafd09fec37e
- [改进] 添加了对 Pylint 2.3.0 和 Astroid 2.2.0 的支持
3.0.0
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [参考] sql-injection: 测试私有属性 (#226)
- [参考] tox: 升级新的 pylint 以兼容 py3 (#215)
2.0.2
- [参考] manifest-required-authors: 支持旧版弃用的参数
2.0.1
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [删除] require-jsdoc, 保留 require-valid-jsdoc
- [修复] 更改 Guidelines URL 的位置
- [添加] development-status-allowed: 新的检查以验证有效的开发状态 修复 https://github.com/OCA/pylint-odoo/issues/199
- [参考] missing-import-error: 仅对 odoo <= 11.0 检查启用
- 将模糊性添加到 ES 全局变量
- 允许使用 `undefined` (#214)
- Jslint jsdoc 放宽 (#209)
- [参考] pylint-odoo: 与 python3.7 兼容 (#205)
- [改进] file-not-used: 忽略迁移目录中的未使用文件 (#213)
- [改进] manifest-required-author: 允许多个可能的必需作者
- [修复] missing-manifest-dependency: 排除测试目录
- [修复] manifest-version-format: 不要忽略有效的 Odoo 版本
- [修复] requirements: 包括 "six" 包 (#207)
2.0.0
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [文档] README.rst: 添加关于根据 Odoo 版本跳过检查的说明
- [参考] requirements: 升级 requirements 版本
- 在 "no missing return" 方法中添加 _register_hook (#201)
- [添加] 添加新的 lint 来检测可翻译字符串中的变量 (#198)
- [修复] translation-required: 修复一些误报 (#196)
- [参考] .travis.yml: 允许 W503 和 W504 格式 (#197)
1.9.5
- [参考] .travis.yml: 仅部署一个环境,避免部署前的清理
1.9.4
- [参考] pylint_odoo: 增加覆盖率测试
- [修复] README.rst: 修复语法和运行检查
- [修复] 在翻译检查中不抱怨字符串属性节点
- [参考] javascript-lint: 允许使用 moment (#189)
- 允许使用简短的三元表达式
- [改进] ESLint 用户体验提升 (#185)
- [参考] javascript-lint: 如果有内部错误,则发出消息
- [参考] jslintrc: 使用点位置属性样式
- [参考] 方法 message_post 需要主题和正文是可翻译的
- [修复] duplicate-xml-fields: 现在考虑使用域和上下文值作为重复项 (#172)
1.9.3
- [参考] pylint_odoo: 使用 check-name 而不是 check-code 为 add_message 方法检查 (#174)
- [修复] pylint_odoo: 改变检查出现的次数 (#173)
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [添加] unnecessary-utf8-coding-comment: 由于使用 py3,因此 Odoo 版本为 11.0 时 utf8 注释是不必要的 (#168)
- [修复] missing-external-dependency: 跳过以点开头的相对导入 (#171)
- [添加] character-not-valid-in-resource-link: 验证 src/href 链接中的 '?' 和 '#' 字符 (#163)
- [参考] javascript-lint: 禁用 comma-dangle 和 prefer-rest-params 检查
- [参考] .travis.yml: 冻结 flake8 版本,以避免添加新检查时的错误红色警告
- [添加] 将 OEEL-1 许可证添加到依赖于企业的模块的 licence-allowed 中 (#165)
- [添加] xml-deprecated-qweb-directive: 弃用 QWeb 指令 (#157)
- [修复] 将 11.0 添加为有效的 Odoo 版本
- [修复] unicode 错误:移除 decode 并使用 bytes - 以 rb 模式打开文件并使用 bytes - 使用 xml_special_char.xml:使用特殊字符来重现解码错误
1.8.2
- [参考] pylint_odoo: 支持 python3
1.8.1
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [修复] deprecated-data-xml-node: 修复与 data/record + record 的 xml 节点的误报 (#156)
- [修复] disable xml check:当方法不是直接调用时调用 get 方法 (#154)
- [修复] misc: TypeError 类型 'NoneType' 的参数不可迭代 (#150)
- [修复] manifest-version-format: 使用正则表达式中的真实点 (#153)
- [修复] manifest-version-format: 为默认的清单版本格式添加字符串结尾的匹配 (#155)
- [添加] xml-deprecated-tree-attribute: 实现 deprecated tree 属性的检查 (#149)
- [参考] jslintrc: 禁用 prefer-spread
- [改进] missing-return: 如果函数是生成器,则跳过缺失的返回值 (#147)
- [改进] missing-return/required-super: setUpClass (#143)
- [改进] missing-readme: 检查其他支持的文件名 (#140)
- [参考] jslintrc: 禁用 prefer-reflect 错误 (#141)
- [REF] 文件未使用:将报告XML文件中引用的文件视为已使用 (#138)
1.8.0
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [REF] 缓存:仅当是odoo模块时才缓存其他扩展文件 (#142)
- [IMP] pylint_odoo:跳过对单个xml文件的pylint检查 (#135)
- [ADD] website-manifest-key-not-valid-uri:验证网站manifest中的URI是否有效 (#136)
1.7.0
- [参考] README:使用 pylint_odoo.messages2rst() 自动更新 (#394)
- [ADD] pylint_odoo:添加新检查资源不存在 (#130)
- [FIX] fields:从根类直接验证分配 (#116)
- [FIX] jslintrc:删除已弃用的ecmaFeatures键
- [ADD] pylint_odoo:添加检查标签内的检测标签并显示警告 (#129)
- [REF] 修复错别字
- [REF] jslint:启用no-comma-dangle检查
- [IMP] sql-injection:支持新情况并忽略一些误报 (#122)
- [FIX] xml-attribute-translatable:如果版本不同8.0则跳过 (#117)
- [FIX] deprecated-module:考虑 'from openerp.osv.expression'
1.6.0
- [REF] README:使用以下脚本自动更新:'PYTHONPATH=~/odoo/pylint-odoo python -c "import pylint_odoo;print pylint_odoo.messages2rst()"'
- [REF] .travis.yml:将flake8错误从F999重命名为F601 (#115)
- [FIX] Check file-not-used:跳过测试文件夹 (#114)
- [FIX] incoherent-interpreter-exec-perm:跳过对Windows的检查 (#113)
- [ADD] except-pass:如果使用except:pass则发出消息 (#107)
- [FIX] attribute-string-redundant:为节点添加"isinstance"验证
- [ADD] attribute-string-redundant:检查"string"参数是否等于变量名 (#100)
- [ADD] renamed-field-parameter:检测弃用的字段值(digits_compute、select) (#99)
- [REF] javascript-lint:使用eslint代替jshint (#97)
- [ADD] xml-attribute-translatable:检查没有翻译参数的XML属性 (#105)
- [REF] incoherent-interpreter-exec-perm:改进消息 (#106)
- [IMP] pylint-odoo:添加对参数--ignore和--ignore-patterns的支持 (#103)
- [ADD] eval-referenced:检测是否有"eval"引用(不调用它) (#101)
- [FIX] duplicate-xml-fields:使用2个树形子视图*2M字段时,使用False红色 (#96)
- [FIX] method-NAME:修复如果值不是字符串的情况
- [REF] misc:删除已弃用方法
- [FIX] test:在测试中从不使用全局变量
1.5.0
- [REF] duplicate-xml-record-id:从manifest获取xml部分以跳过不同来源 (#89)
- [FIX] method-NAME:修复compute=None的情况,修复OCA/pylint-odoo#88
1.4.0
- [REF] attribute-deprecated:弃用length类属性 (#86)
- [ADD] missing-return:如果你调用`super`方法,则需要返回原始值。如果你想要覆盖原始方法,则需要添加说明原因的文档并添加`pylint: disable=missing-return`
- [FIX] 白名单`anybox.testing.openerp` * 添加`anybox.testing.openerp` - 修复#81
- [FIX] manifest-version-format:修复正则表达式以使用显式点而不是任何字符
- [FIX] manifest-version-format:仅支持-e manifest-version-format
- [FIX] missing-import-error:更新requirements.txt中使用的库,但未导入或从odoo中嵌套导入
- [IMP] manifest-version-format:添加valid_odoo_versions参数以强制在manifest版本中使用有效的odoo版本
- [REF] missing-import-error:跳过测试文件,因为这些文件仅在运行测试时加载,在这种情况下,你的模块及其外部依赖项已安装
- [ADD] 支持10.0 manifest名称
- [REF] requirements:更新pylint和astroid的开发者版本
1.3.5
- 添加isort依赖项 (#70)
1.3.4
- [REF] README:更新消息列表
1.3.3
- [ADD] missing-import-error、missing-manifest-dependency
- [FIX] rst-syntax-error:跳过未知角色
- [FIX] rst-syntax-error:跳过未知指令
- [REF] 全局重构:更好的消息输出,在非py文件中使用真实的文件和行号 (#62)
- [REF] README:添加特殊文件夹示例
- [REF] checkers:跳过示例文件夹以进行检查
1.3.2
- [REF] README:更新消息列表
1.3.1
- [ADD] file-not-used:如果有xml、yml、sql或csv文件但不是manifest中引用的,则发出消息 (#53)
- [ADD] dangerous-view-replace-wo-priority:检查具有替换但优先级较低的视图的危险视图 (#55)
- [新增] old-api7-method-defined: 当方法定义包含(self, cr, uid)时发出消息 (#52)
- [新增] odoo-addons-relative-import (#56)
- [参考] tox: 冻结稳定sha pylint20
- [修复] consider-merging-classes-inherited: 如果有'_name'则跳过检查,并在使用'_inherit'名称超出类属性时进行修复。添加更多测试
- [参考] missing-newline-extrafiles: 跳过lib文件夹
- [修复] consider-merging-classes-inherited: 修复不关闭模块不是好主意。更好的做法是关闭方法
- [改进] consider-merging-classes-inherited: 支持禁用注释
- [参考] consider-merging-classes-inherited: 使用赋值节点和更好的消息
- [新增] consider-merging-classes-inherited
- [参考] 提高性能
- [改进] pylint_odoo: 启用cProfile打印统计信息
- [改进] deprecated-module: 为有效openerp.osv.expression的情况添加异常 (#40)
- [改进] sql-injection: 添加与.format的兼容性 (#44)
- [参考] translation-required: 100%覆盖率
- [改进] translation-required: 支持百分号字符串
- [改进] translation-required: 支持format
- [修复] translation-required: 修复 AttributeError 'Getattr' 对象没有属性 'name'
- [改进] translation-required: 只检查odoo异常
- [修复] odoolint: 移除不安全的eval并降低mccabe比率
1.3.0
- [参考] README: 添加新检查 (#36)
- [修复] duplicate-xml-fields: 支持安全xml样式 (#35)
- [新增] sql-injection: 添加新的检查以避免SQL注入 (#29)
- [修复] missing-newline-extrafiles: 通过2个字节的文件修复'IOError: [Errno 22] Invalid argument'
- [参考] README: 添加新检查
- [新增] method-param: 检查方法参数是否以"_param_"开头 (#33)
- [修复] join_node_args_kwargs: AttributeError (#30)
- [参考] duplicate-id-csv: 更好的错误消息 - 之前消息:ir.model.access.csv文件中重复id id_example1 - 现在消息:security/ir.model.access.csv重复id id_example1
- [参考] javascript-lint: 忽略/lib/子文件夹
- [新增] invalid-commit: 添加新检查invalid-commit - 验证指南 https://github.com/oca/maintainer-tools/blob/master/CONTRIBUTING.md#never-commit-the-transaction
1.2.0
- [参考] README.rst: 更新新检查
- [改进] test: 添加tox以支持多环境和添加与最新版本的兼容性
- [新增] translation-required: 添加检查,即使没有翻译也要求 (#23)
- [改进] 添加检查缺失的换行符在额外的扩展文件中
- [改进] test: 添加tox以支持多环境和添加与最新版本的兼容性
- [改进] 添加检查缩进而不是四个空格
- better_msg
- merge
- [参考] test: 更好地识别预期的检查错误
- [改进] 添加检查XML记录中的重复字段 (#20)
- [改进] 添加检查xml_id中的冗余模块名称引用
- [改进] pylint_odoo: 添加检查ir.model.access.csv文件中的重复id
- [改进] pylint_odoo: 添加检查manifest-version-format
- [修复] OCA/MQT#302: 使用astroid版本1.3.8
1.1.0
- [修复] setup: 构建ChangeLog文件
- [新增] 添加检查'deprecated-openerp-xml-node'
- [新增] ChangeLog: 空文件以支持自动构建
- [修复] 将_fields改为_columns
- [REF] 修复错别字
- [改进] 添加检查'create-user-without-reset-password'
- [改进] 支持XML文件中的odoo标签
- [参考] 在检查'duplicate-xml-record-id'中支持'noupdate'
- [参考] setup.cfg: 启用ChangeLog
- [参考] README: 添加新消息manifest-author-string
1.0.2
- 检查作者是否为字符串
1.0.1
- [参考] 将md迁移到rst
1.0.0
- [改进] .travis.yml: 启用从travis自动部署pypi包
- [新增] pylint_odoo: 添加主包
- [新增] .gitignore: 添加gitignore文件以用于首次提交
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源代码发行版
构建发行版
pylint-odoo-9.1.2.tar.gz的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | caff17893895276500cdb3b4314e4a7f77dde4367ecf9b4ef18cac9a2f37ebb4 |
|
| MD5 | 03284cc1ee43626e237567e12eb7df25 |
|
| BLAKE2b-256 | 10ea264324b3b1efdf4b13c052c3ece12f53ab4daa1a7a06a4faa1a870837fa7 |
pylint_odoo-9.1.2-py3-none-any.whl的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 226bf7f7d709538663763a09320a109395b74a1cddfb2af49c42b8c5f4c14cec |
|
| MD5 | 4b46e737e2c1fce11803ba0d395c9d7e |
|
| BLAKE2b-256 | c86f990b06902afa2ac4bad7be6455cd133501e2f45c7afc737060cca416b629 |