-
Notifications
You must be signed in to change notification settings - Fork 89
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
MQT-compatible pre-commit + GitHub actions for 10, 11, 12 #132
Changes from all commits
6757f72
7a8bbd4
3408ea6
9a6cbfe
6a35bba
ae12603
add4eca
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 |
---|---|---|
@@ -1 +1 @@ | ||
./src/.flake8 | ||
./src/{% if odoo_version >= 13 %}.flake8{% endif %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
./src/.isort.cfg | ||
./src/{% if odoo_version > 12 %}.isort.cfg{% endif %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
./src/.prettierrc.yml | ||
./src/{% if odoo_version > 12 %}.prettierrc.yml{% endif %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,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 |
---|---|---|
|
@@ -37,7 +37,10 @@ | |
{%- endif %} | ||
|
||
{#- Older versions that differ a lot have their own hardcoded templates for readability #} | ||
{%- if odoo_version < 14 %} | ||
{%- if odoo_version < 13 %} | ||
{%- include "version-specific/mqt-compat/.pre-commit-config.yaml.jinja" %} | ||
|
||
{%- elif odoo_version < 14 %} | ||
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. Is it possible that this line breaks updates for version < 13 as there is only one 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. 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. Seems unlikely to me. It includes 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's about the line That includes the The line under mqt-compat 😃 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. Oooh I see; it's an But it seems to pass in that one for a 12.0 version. Maybe the blank line ? 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. Maybe it's a string/float problem? It expects a float where there should be a string, or vice versa? Frankly I'm not sure. I wish I knew how to help. 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. You can try replacing Also make sure you're using the latest copier. |
||
{%- include "version-specific/%s/.pre-commit-config.yaml" % odoo_version %} | ||
|
||
{#- Newer versions without hacks are rendered here directly #} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{%- include "version-specific/mqt-compat/.flake8" %} |
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 | ||
# F601 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 |
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: ["{{ repo_website }}"] | ||
- 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.6{% 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,68 @@ | ||
[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={{ org_name }} | ||
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 | ||
|
||
{% block note %}{% endblock %} | ||
|
||
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 | ||
{%- block optional_checks %}{% endblock %} | ||
|
||
[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,91 @@ | ||
{% extends "version-specific/mqt-compat/.pylintrc-mandatory.jinja" %} | ||
{% block note %} | ||
# This .pylintrc contains optional AND mandatory checks and is meant to be | ||
# loaded in an IDE to have it check everything, in the hope this will make | ||
# optional checks more visible to contributors who otherwise never look at a | ||
# green travis to see optional checks that failed. | ||
# .pylintrc-mandatory containing only mandatory checks is used the pre-commit | ||
# config as a blocking check. | ||
|
||
# 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 | ||
{% endblock %} | ||
{% block optional_checks %}, | ||
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, | ||
{% endblock %} |
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.
This is the test of the template, why does it depend on the Odoo/python version combination ?