-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] MQT-compatible pre-commit + GitHub actions for 10, 11, 12 #117
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ odoo_version: | |
type: float | ||
default: 15.0 | ||
choices: | ||
- 10.0 | ||
- 11.0 | ||
- 12.0 | ||
- 13.0 | ||
- 14.0 | ||
- 15.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[flake8] | ||
# E123,E133,E226,E241,E242 are ignored by default by pep8 and flake8 | ||
# F811 is legal in odoo 8 when we implement 2 interfaces for a method | ||
# F999 pylint support this case with expected tests | ||
# W503 changed by W504 and OCA prefers allow both | ||
# E203: whitespace before ':' (black behaviour and not pep8 compliant) | ||
ignore = E123,E133,E226,E241,E242,F811,F601,W503,W504,E203 | ||
max-line-length = 88 | ||
per-file-ignores= | ||
__init__.py:F401 | ||
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not match https://github.com/OCA/maintainer-quality-tools/blob/master/travis/cfg/travis_run_flake8.cfg#L9 This may be intentional, but flagging it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that can be removed because the old flake8 oca/maintainer-quality-tools is using does not support per-file-ignores. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
exclude: | | ||
(?x) | ||
# NOT INSTALLABLE ADDONS | ||
# END NOT INSTALLABLE ADDONS | ||
# Files and folders generated by bots, to avoid loops | ||
^setup/|/static/description/index\.html$| | ||
# We don't want to mess with tool-generated files | ||
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/| | ||
# Maybe reactivate this when all README files include prettier ignore tags? | ||
^README\.md$| | ||
# Library files can have extraneous formatting (even minimized) | ||
/static/(src/)?lib/| | ||
# Repos using Sphinx to generate docs don't need prettying | ||
^docs/_templates/.*\.html$| | ||
# You don't usually want a bot to modify your legal texts | ||
(LICENSE.*|COPYING.*) | ||
default_language_version: | ||
python: python3 | ||
repos: | ||
- repo: https://github.com/oca/maintainer-tools | ||
rev: ab1d7f6 | ||
hooks: | ||
# update the NOT INSTALLABLE ADDONS section above | ||
- id: oca-update-pre-commit-excluded-addons | ||
- id: oca-fix-manifest-website | ||
args: ["https://github.com/OCA/{{ repo_slug }}"] | ||
- repo: https://github.com/acsone/setuptools-odoo | ||
rev: 3.0.6 | ||
hooks: | ||
- id: setuptools-odoo-make-default | ||
{%- if generate_requirements_txt %} | ||
- id: setuptools-odoo-get-requirements | ||
args: | ||
- --output | ||
- requirements.txt | ||
- --header | ||
- "# generated from manifests external_dependencies" | ||
{%- endif %} | ||
- repo: https://github.com/OCA/mirrors-flake8 | ||
rev: v3.4.1 | ||
hooks: | ||
- id: flake8 | ||
language_version: python{% if odoo_version < 11 %}2{% else %}3{% endif %} | ||
name: flake8 excluding __init__.py | ||
exclude: __init__\.py | ||
- repo: https://github.com/pre-commit/mirrors-pylint | ||
rev: v2.5.3 | ||
hooks: | ||
- id: pylint | ||
name: pylint with optional checks | ||
args: | ||
- --rcfile=.pylintrc | ||
- --exit-zero | ||
verbose: true | ||
additional_dependencies: &pylint_deps | ||
- pylint-odoo==3.5.0 | ||
- id: pylint | ||
name: pylint with mandatory checks | ||
args: | ||
- --rcfile=.pylintrc-mandatory | ||
additional_dependencies: *pylint_deps |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
[MASTER] | ||
load-plugins=pylint_odoo | ||
score=n | ||
|
||
[ODOOLINT] | ||
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" | ||
manifest_required_authors=Odoo Community Association (OCA) | ||
manifest_required_keys=license | ||
manifest_deprecated_keys=description,active | ||
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 | ||
valid_odoo_versions={{ odoo_version }} | ||
|
||
[MESSAGES CONTROL] | ||
disable=all | ||
|
||
# Enable message and code: | ||
# anomalous-backslash-in-string - W1401 | ||
# assignment-from-none - W1111 | ||
# dangerous-default-value - W0102 | ||
# duplicate-key - W0109 | ||
# missing-import-error - W7935 | ||
# missing-manifest-dependency - W7936 | ||
# pointless-statement - W0104 | ||
# pointless-string-statement - W0105 | ||
# print-statement - E1601 | ||
# redundant-keyword-arg - E1124 | ||
# reimported - W0404 | ||
# relative-import - W0403 | ||
# return-in-init - E0101 | ||
# rst-syntax-error - E7901 | ||
# too-few-format-args - E1306 | ||
# unreachable - W0101 | ||
|
||
enable=anomalous-backslash-in-string, | ||
assignment-from-none, | ||
dangerous-default-value, | ||
development-status-allowed, | ||
duplicate-key, | ||
duplicate-po-message-definition, | ||
missing-import-error, | ||
missing-manifest-dependency, | ||
po-msgstr-variables, | ||
po-syntax-error, | ||
pointless-statement, | ||
pointless-string-statement, | ||
print-used, | ||
redundant-keyword-arg, | ||
reimported, | ||
relative-import, | ||
return-in-init, | ||
rst-syntax-error, | ||
too-few-format-args, | ||
unreachable, | ||
eval-used, | ||
eval-referenced, | ||
license-allowed, | ||
manifest-author-string, | ||
manifest-required-author, | ||
manifest-required-key, | ||
manifest-version-format, | ||
|
||
[REPORTS] | ||
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} | ||
output-format=colorized | ||
reports=no |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
[MASTER] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd probably be nice to use the same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Proposal in coopiteasy@9ef6115 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've no strong opinion on this. As long as this does the same as the pylint configs of oca/maintainer-quality-tools. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does basically the same, except |
||
load-plugins=pylint_odoo | ||
score=n | ||
|
||
[ODOOLINT] | ||
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" | ||
manifest_required_authors=Odoo Community Association (OCA) | ||
manifest_required_keys=license | ||
manifest_deprecated_keys=description,active | ||
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 | ||
valid_odoo_versions={{ odoo_version }} | ||
|
||
[MESSAGES CONTROL] | ||
disable=all | ||
|
||
# Beta message and code: | ||
# api-one-deprecated - W8104 | ||
# api-one-multi-together - W8101 | ||
# attribute-deprecated - W8105 | ||
# class-camelcase - C8104 | ||
# create-user-wo-reset-password - W7905 | ||
# consider-merging-classes-inherited - R7980 | ||
# copy-wo-api-one - W8102 | ||
# dangerous-filter-wo-user - W7901 | ||
# dangerous-view-replace-wo-priority - W7940 | ||
# deprecated-module - W0402 | ||
# duplicate-id-csv - W7906 | ||
# duplicate-xml-fields - W7907 | ||
# duplicate-xml-record-id - W7902 | ||
# file-not-used - W7930 | ||
# incoherent-interpreter-exec-perm - W8201 | ||
# invalid-commit - E8102 | ||
# javascript-lint - W7903 | ||
# manifest-deprecated-key - C8103 | ||
# method-compute - C8108 | ||
# method-inverse - C8110 | ||
# method-required-super - W8106 | ||
# method-search - C8109 | ||
# missing-newline-extrafiles - W7908 | ||
# missing-readme - C7902 | ||
# no-utf8-coding-comment - C8201 | ||
# unnecessary-utf8-coding-comment - C8202 | ||
# odoo-addons-relative-import - W7950 | ||
# old-api7-method-defined - R8110 | ||
# openerp-exception-warning - R8101 | ||
# redundant-modulename-xml - W7909 | ||
# sql-injection - E8103 | ||
# too-complex - C0901 | ||
# translation-field - W8103 | ||
# translation-required - C8107 | ||
# use-vim-comment - W8202 | ||
# wrong-tabs-instead-of-spaces - W7910 | ||
# xml-syntax-error - E7902 | ||
|
||
enable=api-one-deprecated, | ||
api-one-multi-together, | ||
attribute-deprecated, | ||
class-camelcase, | ||
create-user-wo-reset-password, | ||
consider-merging-classes-inherited, | ||
copy-wo-api-one, | ||
dangerous-filter-wo-user, | ||
dangerous-view-replace-wo-priority, | ||
deprecated-module, | ||
duplicate-id-csv, | ||
duplicate-po-message-definition, | ||
duplicate-xml-fields, | ||
duplicate-xml-record-id, | ||
file-not-used, | ||
incoherent-interpreter-exec-perm, | ||
invalid-commit, | ||
javascript-lint, | ||
manifest-deprecated-key, | ||
method-compute, | ||
method-inverse, | ||
method-required-super, | ||
method-search, | ||
missing-newline-extrafiles, | ||
missing-readme, | ||
po-msgstr-variables, | ||
po-syntax-error, | ||
no-utf8-coding-comment, | ||
unnecessary-utf8-coding-comment, | ||
odoo-addons-relative-import, | ||
old-api7-method-defined, | ||
openerp-exception-warning, | ||
redefined-builtin, | ||
redundant-modulename-xml, | ||
sql-injection, | ||
too-complex, | ||
translation-field, | ||
translation-required, | ||
use-vim-comment, | ||
wrong-tabs-instead-of-spaces, | ||
xml-syntax-error, | ||
|
||
[REPORTS] | ||
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} | ||
output-format=colorized | ||
reports=no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F999 doesn't exist. I think F601 is intended?