Skip to content

Commit c254484

Browse files
committed
Updated from template
1 parent 5968bf8 commit c254484

10 files changed

Lines changed: 195 additions & 58 deletions

File tree

.copier-answers.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Do NOT update manually; changes here will be overwritten by Copier
2-
_commit: v1.17.1
2+
_commit: v1.39
33
_src_path: https://github.com/OCA/oca-addons-repo-template.git
44
ci: GitHub
5-
dependency_installation_mode: OCA
5+
convert_readme_fragments_to_markdown: false
6+
enable_checklog_odoo: false
67
generate_requirements_txt: true
78
github_check_license: true
89
github_ci_extra_env: {}
@@ -20,5 +21,6 @@ repo_description: Miscellaneous Odoo addons by Trevi that do not belong elsewher
2021
repo_name: Miscellaneous Trevi Addons
2122
repo_slug: trevi-misc
2223
repo_website: https://github.com/trevi-software/trevi-misc
23-
travis_apt_packages: []
24-
travis_apt_sources: []
24+
use_pyproject_toml: false
25+
use_ruff: false
26+

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test-requirements.txt merge=union

.github/workflows/pre-commit.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ jobs:
1313
pre-commit:
1414
runs-on: ubuntu-22.04
1515
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-python@v2
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.11"
20+
cache: 'pip'
21+
cache-dependency-path: '.pre-commit-config.yaml'
1822
- name: Get python version
1923
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
20-
- uses: actions/cache@v3
24+
- uses: actions/cache@v4
2125
with:
2226
path: ~/.cache/pre-commit
2327
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}

.github/workflows/stale.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Stale PRs and issues policy
12-
uses: actions/stale@v4
12+
uses: actions/stale@v9
1313
with:
1414
repo-token: ${{ secrets.GITHUB_TOKEN }}
1515
# General settings.
@@ -48,7 +48,7 @@ jobs:
4848
# * Issues that are pending more information
4949
# * Except Issues marked as "no stale"
5050
- name: Needs more information stale issues policy
51-
uses: actions/stale@v4
51+
uses: actions/stale@v9
5252
with:
5353
repo-token: ${{ secrets.GITHUB_TOKEN }}
5454
ascending: true

.github/workflows/test.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
name: Detect unreleased dependencies
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- run: |
1919
for reqfile in requirements.txt test-requirements.txt ; do
2020
if [ -f ${reqfile} ] ; then
@@ -50,7 +50,7 @@ jobs:
5050
ports:
5151
- 5432:5432
5252
steps:
53-
- uses: actions/checkout@v3
53+
- uses: actions/checkout@v4
5454
with:
5555
persist-credentials: false
5656
- name: Install addons and dependencies
@@ -63,7 +63,16 @@ jobs:
6363
run: oca_init_test_database
6464
- name: Run tests
6565
run: oca_run_tests
66-
- uses: codecov/codecov-action@v1
66+
- name: Upload screenshots from JS tests
67+
uses: actions/upload-artifact@v4
68+
if: ${{ failure() }}
69+
with:
70+
name: Screenshots of failed JS tests - ${{ matrix.name }}${{ join(matrix.include) }}
71+
path: /tmp/odoo_tests/${{ env.PGDATABASE }}
72+
if-no-files-found: ignore
73+
- uses: codecov/codecov-action@v4
74+
with:
75+
token: ${{ secrets.CODECOV_TOKEN }}
6776
- name: Update .pot files
6877
run:
6978
oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN

.oca_hooks.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[MESSAGES_CONTROL]
2+
disable=xml-deprecated-data-node,xml-deprecated-tree-attribute

.pre-commit-config.yaml

Lines changed: 136 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,110 @@
1+
exclude: |
2+
(?x)
3+
# NOT INSTALLABLE ADDONS
4+
# END NOT INSTALLABLE ADDONS
5+
# Files and folders generated by bots, to avoid loops
6+
^setup/|/static/description/index\.html$|
7+
# We don't want to mess with tool-generated files
8+
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs|
9+
# Maybe reactivate this when all README files include prettier ignore tags?
10+
^README\.md$|
11+
# Library files can have extraneous formatting (even minimized)
12+
/static/(src/)?lib/|
13+
# Repos using Sphinx to generate docs don't need prettying
14+
^docs/_templates/.*\.html$|
15+
# Don't bother non-technical authors with formatting issues in docs
16+
readme/.*\.(rst|md)$|
17+
# Ignore build and dist directories in addons
18+
/build/|/dist/|
19+
# Ignore test files in addons
20+
/tests/samples/.*|
21+
# You don't usually want a bot to modify your legal texts
22+
(LICENSE.*|COPYING.*)
23+
default_language_version:
24+
python: python3
25+
node: "14.13.0"
126
repos:
2-
- repo: https://github.com/pre-commit/mirrors-prettier
3-
rev: v2.4.1
27+
- repo: local
28+
hooks:
29+
# These files are most likely copier diff rejection junks; if found,
30+
# review them manually, fix the problem (if needed) and remove them
31+
- id: forbidden-files
32+
name: forbidden files
33+
entry: found forbidden files; remove them
34+
language: fail
35+
files: "\\.rej$"
36+
- id: en-po-files
37+
name: en.po files cannot exist
38+
entry: found a en.po file
39+
language: fail
40+
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
41+
- repo: https://github.com/oca/maintainer-tools
42+
rev: f9b919b9868143135a9c9cb03021089cabba8223
43+
hooks:
44+
# update the NOT INSTALLABLE ADDONS section above
45+
- id: oca-update-pre-commit-excluded-addons
46+
- id: oca-fix-manifest-website
47+
args: ["https://github.com/trevi-software/trevi-misc"]
48+
- id: oca-gen-addon-readme
49+
args:
50+
- --addons-dir=.
51+
- --branch=14.0
52+
- --org-name=trevi-software
53+
- --repo-name=trevi-misc
54+
- --if-source-changed
55+
- --keep-source-digest
56+
- repo: https://github.com/OCA/odoo-pre-commit-hooks
57+
rev: v0.0.25
58+
hooks:
59+
- id: oca-checks-odoo-module
60+
- id: oca-checks-po
61+
args:
62+
- --disable=po-pretty-format
63+
- repo: https://github.com/myint/autoflake
64+
rev: v1.5.3
65+
hooks:
66+
- id: autoflake
67+
args:
68+
- --expand-star-imports
69+
- --ignore-init-module-imports
70+
- --in-place
71+
- --remove-all-unused-imports
72+
- --remove-duplicate-keys
73+
- --remove-unused-variables
74+
- repo: https://github.com/psf/black
75+
rev: 22.3.0
76+
hooks:
77+
- id: black
78+
- repo: local
479
hooks:
580
- id: prettier
6-
# https://github.com/prettier/prettier/issues/12143
7-
exclude: "}$"
81+
name: prettier (with plugin-xml)
82+
entry: prettier
83+
args:
84+
- --write
85+
- --list-different
86+
- --ignore-unknown
87+
types: [text]
88+
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
89+
language: node
90+
additional_dependencies:
91+
- "prettier@2.1.2"
92+
- "@prettier/plugin-xml@0.12.0"
93+
- repo: local
94+
hooks:
95+
- id: eslint
96+
name: eslint
97+
entry: eslint
98+
args:
99+
- --color
100+
- --fix
101+
verbose: true
102+
types: [javascript]
103+
language: node
104+
additional_dependencies:
105+
- "eslint@7.8.1"
106+
- "eslint-plugin-jsdoc@"
107+
- "globals@"
8108
- repo: https://github.com/pre-commit/pre-commit-hooks
9109
rev: v4.5.0
10110
hooks:
@@ -20,10 +120,36 @@ repos:
20120
args: ["--remove"]
21121
- id: mixed-line-ending
22122
args: ["--fix=lf"]
23-
- id: trailing-whitespace
24-
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: v0.1.3
123+
- repo: https://github.com/asottile/pyupgrade
124+
rev: v2.7.2
125+
hooks:
126+
- id: pyupgrade
127+
args: ["--keep-percent-format"]
128+
- repo: https://github.com/PyCQA/isort
129+
rev: 5.12.0
130+
hooks:
131+
- id: isort
132+
name: isort except __init__.py
133+
args:
134+
- --settings=.
135+
exclude: /__init__\.py$
136+
- repo: https://github.com/acsone/setuptools-odoo
137+
rev: 3.3.2
138+
hooks:
139+
- id: setuptools-odoo-make-default
140+
- id: setuptools-odoo-get-requirements
141+
args:
142+
- --output
143+
- requirements.txt
144+
- --header
145+
- "# generated from manifests external_dependencies"
146+
- repo: https://github.com/PyCQA/flake8
147+
rev: 5.0.0
148+
hooks:
149+
- id: flake8
150+
name: flake8
151+
additional_dependencies: ["flake8-bugbear==20.1.4"]
152+
- repo: https://github.com/OCA/pylint-odoo
153+
rev: 7.0.2
26154
hooks:
27-
- id: ruff
28-
args: [--exit-non-zero-on-fix]
29-
- id: ruff-format
155+
- id: pylint_odoo

.pylintrc

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,25 @@ disable=all
2525
enable=anomalous-backslash-in-string,
2626
api-one-deprecated,
2727
api-one-multi-together,
28-
assignment-from-none,
29-
attribute-deprecated,
3028
class-camelcase,
31-
dangerous-default-value,
3229
dangerous-view-replace-wo-priority,
33-
development-status-allowed,
3430
duplicate-id-csv,
35-
duplicate-key,
3631
duplicate-xml-fields,
3732
duplicate-xml-record-id,
3833
eval-referenced,
39-
eval-used,
4034
incoherent-interpreter-exec-perm,
35+
openerp-exception-warning,
36+
redundant-modulename-xml,
37+
relative-import,
38+
rst-syntax-error,
39+
wrong-tabs-instead-of-spaces,
40+
xml-syntax-error,
41+
assignment-from-none,
42+
attribute-deprecated,
43+
dangerous-default-value,
44+
development-status-allowed,
45+
duplicate-key,
46+
eval-used,
4147
license-allowed,
4248
manifest-author-string,
4349
manifest-deprecated-key,
@@ -48,40 +54,28 @@ enable=anomalous-backslash-in-string,
4854
method-inverse,
4955
method-required-super,
5056
method-search,
51-
openerp-exception-warning,
5257
pointless-statement,
5358
pointless-string-statement,
5459
print-used,
5560
redundant-keyword-arg,
56-
redundant-modulename-xml,
5761
reimported,
58-
relative-import,
5962
return-in-init,
60-
rst-syntax-error,
6163
sql-injection,
6264
too-few-format-args,
6365
translation-field,
6466
translation-required,
6567
unreachable,
6668
use-vim-comment,
67-
wrong-tabs-instead-of-spaces,
68-
xml-syntax-error,
69+
missing-manifest-dependency,
70+
too-complex,
6971
# messages that do not cause the lint step to fail
7072
consider-merging-classes-inherited,
71-
create-user-wo-reset-password,
72-
dangerous-filter-wo-user,
7373
deprecated-module,
74-
file-not-used,
7574
invalid-commit,
76-
missing-manifest-dependency,
77-
missing-newline-extrafiles,
7875
missing-readme,
79-
no-utf8-coding-comment,
8076
odoo-addons-relative-import,
81-
old-api7-method-defined,
8277
redefined-builtin,
83-
too-complex,
84-
unnecessary-utf8-coding-comment
78+
manifest-external-assets
8579

8680

8781
[REPORTS]

.pylintrc-mandatory

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,25 @@ disable=all
1717
enable=anomalous-backslash-in-string,
1818
api-one-deprecated,
1919
api-one-multi-together,
20-
assignment-from-none,
21-
attribute-deprecated,
2220
class-camelcase,
23-
dangerous-default-value,
2421
dangerous-view-replace-wo-priority,
25-
development-status-allowed,
2622
duplicate-id-csv,
27-
duplicate-key,
2823
duplicate-xml-fields,
2924
duplicate-xml-record-id,
3025
eval-referenced,
31-
eval-used,
3226
incoherent-interpreter-exec-perm,
27+
openerp-exception-warning,
28+
redundant-modulename-xml,
29+
relative-import,
30+
rst-syntax-error,
31+
wrong-tabs-instead-of-spaces,
32+
xml-syntax-error,
33+
assignment-from-none,
34+
attribute-deprecated,
35+
dangerous-default-value,
36+
development-status-allowed,
37+
duplicate-key,
38+
eval-used,
3339
license-allowed,
3440
manifest-author-string,
3541
manifest-deprecated-key,
@@ -40,24 +46,18 @@ enable=anomalous-backslash-in-string,
4046
method-inverse,
4147
method-required-super,
4248
method-search,
43-
openerp-exception-warning,
4449
pointless-statement,
4550
pointless-string-statement,
4651
print-used,
4752
redundant-keyword-arg,
48-
redundant-modulename-xml,
4953
reimported,
50-
relative-import,
5154
return-in-init,
52-
rst-syntax-error,
5355
sql-injection,
5456
too-few-format-args,
5557
translation-field,
5658
translation-required,
5759
unreachable,
58-
use-vim-comment,
59-
wrong-tabs-instead-of-spaces,
60-
xml-syntax-error
60+
use-vim-comment
6161

6262
[REPORTS]
6363
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}

0 commit comments

Comments
 (0)