Skip to content

Commit 5654c56

Browse files
committed
Update template for V16
1 parent b7e3503 commit 5654c56

14 files changed

+250
-120
lines changed

.copier-answers.yml

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
# Do NOT update manually; changes here will be overwritten by Copier
2-
_commit: v1.0.5
2+
_commit: v1.11.1
33
_src_path: https://github.com/OCA/oca-addons-repo-template.git
4+
ci: GitHub
45
dependency_installation_mode: PIP
56
generate_requirements_txt: true
7+
github_check_license: true
8+
github_enable_codecov: true
9+
github_enable_makepot: true
10+
github_enable_stale_action: false
11+
github_enforce_dev_status_compatibility: false
612
include_wkhtmltopdf: false
7-
odoo_version: 14.0
13+
odoo_version: 16.0
14+
org_name: Akretion
15+
org_slug: akretion
816
rebel_module_groups: []
9-
repo_description: The modules present in this repo should go to OCA on the long run,
10-
they are still not used a lot and still need to prove themselves
11-
repo_name: Generic Odoo module in incubation
17+
repo_description: Misc Odoo modules maturing before going to a specific repo
18+
repo_name: Akretion Odoo Module Incubator
1219
repo_slug: ak-odoo-incubator
20+
repo_website: https://github.com/akretion/ak-odoo-incubator
1321
travis_apt_packages: []
14-
travis_apt_sources: yml
22+
travis_apt_sources: []
23+

.eslintrc.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
env:
22
browser: true
3+
es6: true
34

45
# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
56
parserOptions:
6-
ecmaVersion: 2017
7+
ecmaVersion: 2019
8+
9+
overrides:
10+
- files:
11+
- "**/*.esm.js"
12+
parserOptions:
13+
sourceType: module
714

815
# Globals available in Odoo that shouldn't produce errorings
916
globals:
@@ -14,7 +21,7 @@ globals:
1421
moment: readonly
1522
odoo: readonly
1623
openerp: readonly
17-
Promise: readonly
24+
owl: readonly
1825

1926
# Styling is handled by Prettier, so we only need to enable AST rules;
2027
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890

.flake8

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
max-line-length = 80
2+
max-line-length = 88
33
max-complexity = 16
44
# B = bugbear
55
# B9 = bugbear opinionated (incl line length)
@@ -8,3 +8,5 @@ select = C,E,F,W,B,B9
88
# E501: flake8 line length (covered by bugbear B950)
99
# W503: line break before binary operator (black behaviour)
1010
ignore = E203,E501,W503
11+
per-file-ignores=
12+
__init__.py:F401

.github/workflows/pre-commit.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "16.0*"
7+
push:
8+
branches:
9+
- "16.0"
10+
- "16.0-ocabot-*"
11+
12+
jobs:
13+
pre-commit:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-python@v2
18+
- name: Get python version
19+
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
20+
- uses: actions/cache@v1
21+
with:
22+
path: ~/.cache/pre-commit
23+
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
24+
- name: Install pre-commit
25+
run: pip install pre-commit
26+
- name: Run pre-commit
27+
run: pre-commit run --all-files --show-diff-on-failure --color=always
28+
- name: Check that all files generated by pre-commit are in git
29+
run: |
30+
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
31+
if [ "$newfiles" != "" ] ; then
32+
echo "Please check-in the following files:"
33+
echo "$newfiles"
34+
exit 1
35+
fi

.github/workflows/test.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "16.0*"
7+
push:
8+
branches:
9+
- "16.0"
10+
- "16.0-ocabot-*"
11+
12+
jobs:
13+
unreleased-deps:
14+
runs-on: ubuntu-latest
15+
name: Detect unreleased dependencies
16+
steps:
17+
- uses: actions/checkout@v2
18+
- run: |
19+
for reqfile in requirements.txt test-requirements.txt ; do
20+
if [ -f ${reqfile} ] ; then
21+
result=0
22+
# reject non-comment lines that contain a / (i.e. URLs, relative paths)
23+
grep "^[^#].*/" ${reqfile} || result=$?
24+
if [ $result -eq 0 ] ; then
25+
echo "Unreleased dependencies found in ${reqfile}."
26+
exit 1
27+
fi
28+
fi
29+
done
30+
test:
31+
runs-on: ubuntu-latest
32+
container: ${{ matrix.container }}
33+
name: ${{ matrix.name }}
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
include:
38+
- container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest
39+
makepot: "true"
40+
name: test with Odoo
41+
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
42+
name: test with OCB
43+
services:
44+
postgres:
45+
image: postgres:12.0
46+
env:
47+
POSTGRES_USER: odoo
48+
POSTGRES_PASSWORD: odoo
49+
POSTGRES_DB: odoo
50+
ports:
51+
- 5432:5432
52+
steps:
53+
- uses: actions/checkout@v2
54+
with:
55+
persist-credentials: false
56+
- name: Install addons and dependencies
57+
run: oca_install_addons
58+
- name: Check licenses
59+
run: manifestoo -d . check-licenses
60+
- name: Check development status
61+
run: manifestoo -d . check-dev-status --default-dev-status=Beta
62+
continue-on-error: true
63+
- name: Initialize test db
64+
run: oca_init_test_database
65+
- name: Run tests
66+
run: oca_run_tests
67+
- uses: codecov/codecov-action@v1
68+
- name: Update .pot files
69+
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
70+
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'akretion' }}

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ build/
1515
develop-eggs/
1616
dist/
1717
eggs/
18-
lib/
1918
lib64/
2019
parts/
2120
sdist/

.isort.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ known_odoo=odoo
1010
known_odoo_addons=odoo.addons
1111
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER
1212
default_section=THIRDPARTY
13+
ensure_newline_before_comments = True

.pre-commit-config.yaml

+33-34
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
21
exclude: |
32
(?x)
43
# NOT INSTALLABLE ADDONS
54
# END NOT INSTALLABLE ADDONS
65
# Files and folders generated by bots, to avoid loops
76
^setup/|/static/description/index\.html$|
7+
# We don't want to mess with tool-generated files
8+
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
89
# Maybe reactivate this when all README files include prettier ignore tags?
910
^README\.md$|
1011
# Library files can have extraneous formatting (even minimized)
@@ -15,7 +16,7 @@ exclude: |
1516
(LICENSE.*|COPYING.*)
1617
default_language_version:
1718
python: python3
18-
node: "14.13.0"
19+
node: "16.17.0"
1920
repos:
2021
- repo: local
2122
hooks:
@@ -27,41 +28,48 @@ repos:
2728
language: fail
2829
files: "\\.rej$"
2930
- repo: https://github.com/oca/maintainer-tools
30-
rev: 1b5c7ad
31+
rev: 4cd2b852214dead80822e93e6749b16f2785b2fe
3132
hooks:
3233
# update the NOT INSTALLABLE ADDONS section above
3334
- id: oca-update-pre-commit-excluded-addons
3435
- id: oca-fix-manifest-website
35-
args: ["https://github.com/OCA/ak-odoo-incubator"]
36+
args: ["https://github.com/akretion/ak-odoo-incubator"]
3637
- repo: https://github.com/myint/autoflake
37-
rev: v1.4
38+
rev: v1.6.1
3839
hooks:
3940
- id: autoflake
40-
args: ["-i", "--ignore-init-module-imports"]
41+
args:
42+
- --expand-star-imports
43+
- --ignore-init-module-imports
44+
- --in-place
45+
- --remove-all-unused-imports
46+
- --remove-duplicate-keys
47+
- --remove-unused-variables
4148
- repo: https://github.com/psf/black
42-
rev: 20.8b1
49+
rev: 22.8.0
4350
hooks:
4451
- id: black
4552
- repo: https://github.com/pre-commit/mirrors-prettier
46-
rev: v2.1.2
53+
rev: v2.7.1
4754
hooks:
4855
- id: prettier
49-
name: prettier + plugin-xml
56+
name: prettier (with plugin-xml)
5057
additional_dependencies:
51-
- "prettier@2.1.2"
52-
- "@prettier/plugin-xml@0.12.0"
58+
- "prettier@2.7.1"
59+
- "@prettier/plugin-xml@2.2.0"
5360
args:
5461
- --plugin=@prettier/plugin-xml
62+
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
5563
- repo: https://github.com/pre-commit/mirrors-eslint
56-
rev: v7.8.1
64+
rev: v8.24.0
5765
hooks:
5866
- id: eslint
5967
verbose: true
6068
args:
6169
- --color
6270
- --fix
6371
- repo: https://github.com/pre-commit/pre-commit-hooks
64-
rev: v3.2.0
72+
rev: v4.3.0
6573
hooks:
6674
- id: trailing-whitespace
6775
# exclude autogenerated files
@@ -83,19 +91,20 @@ repos:
8391
- id: mixed-line-ending
8492
args: ["--fix=lf"]
8593
- repo: https://github.com/asottile/pyupgrade
86-
rev: v2.7.2
94+
rev: v2.38.2
8795
hooks:
8896
- id: pyupgrade
97+
args: ["--keep-percent-format"]
8998
- repo: https://github.com/PyCQA/isort
90-
rev: 5.5.1
99+
rev: 5.10.1
91100
hooks:
92101
- id: isort
93102
name: isort except __init__.py
94103
args:
95104
- --settings=.
96105
exclude: /__init__\.py$
97106
- repo: https://github.com/acsone/setuptools-odoo
98-
rev: 2.6.0
107+
rev: 3.1.8
99108
hooks:
100109
- id: setuptools-odoo-make-default
101110
- id: setuptools-odoo-get-requirements
@@ -104,31 +113,21 @@ repos:
104113
- requirements.txt
105114
- --header
106115
- "# generated from manifests external_dependencies"
107-
- repo: https://gitlab.com/PyCQA/flake8
108-
rev: 3.8.3
116+
- repo: https://github.com/PyCQA/flake8
117+
rev: 3.9.2
109118
hooks:
110119
- id: flake8
111-
name: flake8 except __init__.py
112-
exclude: /__init__\.py$
113-
additional_dependencies: ["flake8-bugbear==20.1.4"]
114-
- id: flake8
115-
name: flake8 only __init__.py
116-
args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
117-
files: /__init__\.py$
118-
additional_dependencies: ["flake8-bugbear==20.1.4"]
119-
- repo: https://github.com/PyCQA/pylint
120-
rev: pylint-2.5.3
120+
name: flake8
121+
additional_dependencies: ["flake8-bugbear==21.9.2"]
122+
- repo: https://github.com/OCA/pylint-odoo
123+
rev: 7.0.2
121124
hooks:
122-
- id: pylint
125+
- id: pylint_odoo
123126
name: pylint with optional checks
124127
args:
125128
- --rcfile=.pylintrc
126129
- --exit-zero
127130
verbose: true
128-
additional_dependencies: &pylint_deps
129-
- pylint-odoo==3.5.0
130-
- id: pylint
131-
name: pylint with mandatory checks
131+
- id: pylint_odoo
132132
args:
133133
- --rcfile=.pylintrc-mandatory
134-
additional_dependencies: *pylint_deps

.pylintrc

+37-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
2+
13
[MASTER]
24
load-plugins=pylint_odoo
35
score=n
46

57
[ODOOLINT]
68
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
7-
manifest_required_authors=Odoo Community Association (OCA)
9+
manifest_required_authors=Akretion
810
manifest_required_keys=license
911
manifest_deprecated_keys=description,active
1012
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
11-
valid_odoo_versions=14.0
13+
valid_odoo_versions=16.0
1214

1315
[MESSAGES CONTROL]
1416
disable=all
@@ -64,6 +66,39 @@ enable=anomalous-backslash-in-string,
6466
use-vim-comment,
6567
wrong-tabs-instead-of-spaces,
6668
xml-syntax-error,
69+
attribute-string-redundant,
70+
character-not-valid-in-resource-link,
71+
consider-merging-classes-inherited,
72+
context-overridden,
73+
create-user-wo-reset-password,
74+
dangerous-filter-wo-user,
75+
dangerous-qweb-replace-wo-priority,
76+
deprecated-data-xml-node,
77+
deprecated-openerp-xml-node,
78+
duplicate-po-message-definition,
79+
except-pass,
80+
file-not-used,
81+
invalid-commit,
82+
manifest-maintainers-list,
83+
missing-newline-extrafiles,
84+
missing-readme,
85+
missing-return,
86+
odoo-addons-relative-import,
87+
old-api7-method-defined,
88+
po-msgstr-variables,
89+
po-syntax-error,
90+
renamed-field-parameter,
91+
resource-not-exist,
92+
str-format-used,
93+
test-folder-imported,
94+
translation-contains-variable,
95+
translation-positional-used,
96+
unnecessary-utf8-coding-comment,
97+
website-manifest-key-not-valid-uri,
98+
xml-attribute-translatable,
99+
xml-deprecated-qweb-directive,
100+
xml-deprecated-tree-attribute,
101+
external-request-timeout,
67102
# messages that do not cause the lint step to fail
68103
consider-merging-classes-inherited,
69104
create-user-wo-reset-password,

0 commit comments

Comments
 (0)