Skip to content

Commit 0573806

Browse files
committed
[INIT] Initialize repo with copier template.
1 parent 9a93819 commit 0573806

16 files changed

+1563
-7
lines changed

.copier-answers.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ _src_path: https://github.com/grap/oca-addons-repo-template-v16
44
additional_ruff_rules: []
55
ci: GitHub
66
convert_readme_fragments_to_markdown: true
7-
enable_checklog_odoo: false
7+
enable_checklog_odoo: true
88
generate_requirements_txt: true
99
github_check_license: true
1010
github_ci_extra_env: {}
1111
github_enable_codecov: true
1212
github_enable_makepot: false
1313
github_enable_stale_action: false
14-
github_enforce_dev_status_compatibility: false
14+
github_enforce_dev_status_compatibility: true
1515
include_wkhtmltopdf: false
1616
odoo_test_flavor: Odoo
17-
odoo_version: 16.0
17+
odoo_version: 18.0
1818
org_name: GRAP
1919
org_slug: grap
2020
rebel_module_groups: []
@@ -23,9 +23,6 @@ repo_description: This repository contains Odoo modules developped by the compan
2323
repo_name: Custom Odoo modules for GRAP
2424
repo_slug: grap-odoo-custom
2525
repo_website: https://github.com/grap/grap-odoo-custom
26-
use_pyproject_toml: false
26+
use_pyproject_toml: true
2727
use_ruff: true
2828

29-
convert_readme_fragments_to_markdown: true
30-
odoo_test_flavor: Odoo
31-
use_ruff: true

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Configuration for known file extensions
2+
[*.{css,js,json,less,md,py,rst,sass,scss,xml,yaml,yml}]
3+
charset = utf-8
4+
end_of_line = lf
5+
indent_size = 4
6+
indent_style = space
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.{json,yml,yaml,rst,md}]
11+
indent_size = 2
12+
13+
# Do not configure editor for libs and autogenerated content
14+
[{*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst}]
15+
charset = unset
16+
end_of_line = unset
17+
indent_size = unset
18+
indent_style = unset
19+
insert_final_newline = false
20+
trim_trailing_whitespace = false

.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: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "18.0*"
7+
push:
8+
branches:
9+
- "18.0"
10+
- "18.0-ocabot-*"
11+
12+
jobs:
13+
pre-commit:
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.11"
20+
- name: Get python version
21+
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
22+
- uses: actions/cache@v4
23+
with:
24+
path: ~/.cache/pre-commit
25+
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
26+
- name: Install pre-commit
27+
run: pip install pre-commit
28+
- name: Run pre-commit
29+
run: pre-commit run --all-files --show-diff-on-failure --color=always
30+
env:
31+
# Consider valid a PR that changes README fragments but doesn't
32+
# change the README.rst file itself. It's not really a problem
33+
# because the bot will update it anyway after merge. This way, we
34+
# lower the barrier for functional contributors that want to fix the
35+
# readme fragments, while still letting developers get README
36+
# auto-generated (which also helps functionals when using runboat).
37+
# DOCS https://pre-commit.com/#temporarily-disabling-hooks
38+
SKIP: oca-gen-addon-readme
39+
- name: Check that all files generated by pre-commit are in git
40+
run: |
41+
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
42+
if [ "$newfiles" != "" ] ; then
43+
echo "Please check-in the following files:"
44+
echo "$newfiles"
45+
exit 1
46+
fi

.github/workflows/test.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "18.0*"
7+
push:
8+
branches:
9+
- "18.0"
10+
- "18.0-ocabot-*"
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-22.04
15+
container: ${{ matrix.container }}
16+
name: ${{ matrix.name }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- container: ghcr.io/oca/oca-ci/py3.10-odoo18.0:latest
22+
name: test with Odoo
23+
makepot: "false"
24+
services:
25+
postgres:
26+
image: postgres:12
27+
env:
28+
POSTGRES_USER: odoo
29+
POSTGRES_PASSWORD: odoo
30+
POSTGRES_DB: odoo
31+
ports:
32+
- 5432:5432
33+
env:
34+
OCA_ENABLE_CHECKLOG_ODOO: "1"
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
persist-credentials: false
39+
- name: Install addons and dependencies
40+
run: oca_install_addons
41+
- name: Check licenses
42+
run: manifestoo -d . check-licenses
43+
- name: Check development status
44+
run: manifestoo -d . check-dev-status --default-dev-status=Beta
45+
- name: Initialize test db
46+
run: oca_init_test_database
47+
- name: Run tests
48+
run: oca_run_tests
49+
- uses: codecov/codecov-action@v4
50+
with:
51+
token: ${{ secrets.CODECOV_TOKEN }}
52+
- name: Update .pot files
53+
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
54+
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'grap' }}

.gitignore

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# <GRAP>
2+
# Do not share pdf file. (grap-odoo-business-supplier-invoice)
3+
*.pdf
4+
# </GRAP>
5+
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
/.venv
10+
/.pytest_cache
11+
/.ruff_cache
12+
13+
# C extensions
14+
*.so
15+
16+
# Distribution / packaging
17+
.Python
18+
env/
19+
bin/
20+
build/
21+
develop-eggs/
22+
dist/
23+
eggs/
24+
lib64/
25+
parts/
26+
sdist/
27+
var/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
*.eggs
32+
33+
# Windows installers
34+
*.msi
35+
36+
# Debian packages
37+
*.deb
38+
39+
# Redhat packages
40+
*.rpm
41+
42+
# MacOS packages
43+
*.dmg
44+
*.pkg
45+
46+
# Installer logs
47+
pip-log.txt
48+
pip-delete-this-directory.txt
49+
50+
# Unit test / coverage reports
51+
htmlcov/
52+
.tox/
53+
.coverage
54+
.cache
55+
nosetests.xml
56+
coverage.xml
57+
58+
# Translations
59+
*.mo
60+
61+
# Pycharm
62+
.idea
63+
64+
# Eclipse
65+
.settings
66+
67+
# Visual Studio cache/options directory
68+
.vs/
69+
.vscode
70+
71+
# OSX Files
72+
.DS_Store
73+
74+
# Django stuff:
75+
*.log
76+
77+
# Mr Developer
78+
.mr.developer.cfg
79+
.project
80+
.pydevproject
81+
82+
# Rope
83+
.ropeproject
84+
85+
# Sphinx documentation
86+
docs/_build/
87+
88+
# Backup files
89+
*~
90+
*.swp
91+
92+
# OCA rules
93+
!static/lib/

.pre-commit-config.yaml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
exclude: |
2+
(?x)
3+
# NOT INSTALLABLE ADDONS
4+
# END NOT INSTALLABLE ADDONS
5+
# <GRAP> Do no touch encrypted files
6+
.*\.encrypted|
7+
# Files and folders generated by bots, to avoid loops
8+
^setup/|/static/description/index\.html$|
9+
# We don't want to mess with tool-generated files
10+
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs|
11+
# Maybe reactivate this when all README files include prettier ignore tags?
12+
^README\.md$|
13+
# Library files can have extraneous formatting (even minimized)
14+
/static/(src/)?lib/|
15+
# Repos using Sphinx to generate docs don't need prettying
16+
^docs/_templates/.*\.html$|
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: "22.9.0"
26+
repos:
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/sbidoul/whool
42+
rev: v1.3
43+
hooks:
44+
- id: whool-init
45+
- repo: https://github.com/oca/maintainer-tools
46+
rev: b89f767503be6ab2b11e4f50a7557cb20066e667
47+
hooks:
48+
# update the NOT INSTALLABLE ADDONS section above
49+
- id: oca-update-pre-commit-excluded-addons
50+
- id: oca-fix-manifest-website
51+
args: ["https://github.com/grap/grap-odoo-custom"]
52+
- id: oca-gen-addon-readme
53+
args:
54+
- --addons-dir=.
55+
- --branch=18.0
56+
- --org-name=grap
57+
- --repo-name=grap-odoo-custom
58+
- --if-source-changed
59+
- --no-gen-html
60+
- --keep-source-digest
61+
- --convert-fragments-to-markdown
62+
- id: oca-gen-external-dependencies
63+
- repo: https://github.com/OCA/odoo-pre-commit-hooks
64+
rev: v0.0.33
65+
hooks:
66+
- id: oca-checks-odoo-module
67+
- id: oca-checks-po
68+
args:
69+
- --disable=po-pretty-format
70+
- repo: local
71+
hooks:
72+
- id: eslint
73+
name: eslint
74+
entry: eslint
75+
args:
76+
- --color
77+
- --fix
78+
verbose: true
79+
types: [javascript]
80+
language: node
81+
additional_dependencies:
82+
83+
84+
85+
- repo: https://github.com/pre-commit/pre-commit-hooks
86+
rev: v4.6.0
87+
hooks:
88+
- id: trailing-whitespace
89+
# exclude autogenerated files
90+
exclude: /README\.rst$|\.pot?$
91+
- id: end-of-file-fixer
92+
# exclude autogenerated files
93+
exclude: /README\.rst$|\.pot?$
94+
- id: debug-statements
95+
- id: fix-encoding-pragma
96+
args: ["--remove"]
97+
- id: check-case-conflict
98+
- id: check-docstring-first
99+
- id: check-executables-have-shebangs
100+
- id: check-merge-conflict
101+
# exclude files where underlines are not distinguishable from merge conflicts
102+
exclude: /README\.rst$|^docs/.*\.rst$
103+
- id: check-symlinks
104+
- id: check-xml
105+
- id: mixed-line-ending
106+
args: ["--fix=lf"]
107+
- repo: https://github.com/astral-sh/ruff-pre-commit
108+
rev: v0.6.8
109+
hooks:
110+
- id: ruff
111+
args: [--fix, --exit-non-zero-on-fix]
112+
- id: ruff-format
113+
- repo: https://github.com/OCA/pylint-odoo
114+
rev: v9.1.3
115+
hooks:
116+
- id: pylint_odoo
117+
name: pylint with optional checks
118+
args:
119+
- --rcfile=.pylintrc
120+
- --exit-zero
121+
verbose: true
122+
- id: pylint_odoo
123+
args:
124+
- --rcfile=.pylintrc-mandatory
125+
- repo: https://github.com/jackdewinter/pymarkdown
126+
rev: v0.9.32
127+
hooks:
128+
- id: pymarkdown

0 commit comments

Comments
 (0)