Skip to content

Commit 1d32f9d

Browse files
committed
First Commit
0 parents  commit 1d32f9d

File tree

14 files changed

+1560
-0
lines changed

14 files changed

+1560
-0
lines changed

.copier-answers.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Do NOT update manually; changes here will be overwritten by Copier
2+
_commit: 70a53f0
3+
_src_path: https://github.com/OdooDataFlow/odf-addons-repo-template.git
4+
additional_ruff_rules: []
5+
ci: GitHub
6+
convert_readme_fragments_to_markdown: true
7+
enable_checklog_odoo: true
8+
generate_requirements_txt: true
9+
github_check_license: true
10+
github_ci_extra_env: {}
11+
github_enable_codecov: true
12+
github_enable_makepot: true
13+
github_enable_stale_action: false
14+
github_enforce_dev_status_compatibility: false
15+
include_wkhtmltopdf: false
16+
odoo_test_flavor: Odoo
17+
odoo_version: 18.0
18+
org_name: Odoo Data Flow
19+
org_slug: OdooDataFlow
20+
rebel_module_groups: []
21+
repo_description: Helper odoo modules to ease the data import / export.
22+
repo_name: Tools for Data Import / Export
23+
repo_slug: addons
24+
repo_website: https://github.com/OdooDataFlow/addons
25+
use_pyproject_toml: true
26+
use_ruff: true
27+

.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

.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: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
unreleased-deps:
14+
runs-on: ubuntu-latest
15+
name: Detect unreleased dependencies
16+
steps:
17+
- uses: actions/checkout@v4
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-22.04
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-odoo18.0:latest
39+
name: test with Odoo
40+
makepot: "true"
41+
services:
42+
postgres:
43+
image: postgres:12.0
44+
env:
45+
POSTGRES_USER: odoo
46+
POSTGRES_PASSWORD: odoo
47+
POSTGRES_DB: odoo
48+
ports:
49+
- 5432:5432
50+
env:
51+
OCA_ENABLE_CHECKLOG_ODOO: "1"
52+
steps:
53+
- uses: actions/checkout@v4
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@v4
68+
with:
69+
token: ${{ secrets.CODECOV_TOKEN }}
70+
- name: Update .pot files
71+
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
72+
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OdooDataFlow' }}

.gitignore

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

.pre-commit-config.yaml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
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: "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.2
43+
hooks:
44+
- id: whool-init
45+
- repo: https://github.com/oca/maintainer-tools
46+
rev: bf9ecb9938b6a5deca0ff3d870fbd3f33341fded
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/OdooDataFlow/addons"]
52+
- id: oca-gen-addon-readme
53+
args:
54+
- --addons-dir=.
55+
- --branch=18.0
56+
- --org-name=OdooDataFlow
57+
- --repo-name=addons
58+
- --if-source-changed
59+
- --keep-source-digest
60+
- --convert-fragments-to-markdown
61+
- id: oca-gen-external-dependencies
62+
- repo: https://github.com/OCA/odoo-pre-commit-hooks
63+
rev: v0.1.1
64+
hooks:
65+
- id: oca-checks-odoo-module
66+
- id: oca-checks-po
67+
args:
68+
- --disable=po-pretty-format
69+
- repo: local
70+
hooks:
71+
- id: prettier
72+
name: prettier (with plugin-xml)
73+
entry: prettier
74+
args:
75+
- --write
76+
- --list-different
77+
- --ignore-unknown
78+
types: [text]
79+
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
80+
language: node
81+
additional_dependencies:
82+
83+
- "@prettier/[email protected]"
84+
- repo: local
85+
hooks:
86+
- id: eslint
87+
name: eslint
88+
entry: eslint
89+
args:
90+
- --color
91+
- --fix
92+
verbose: true
93+
types: [javascript]
94+
language: node
95+
additional_dependencies:
96+
97+
98+
99+
- repo: https://github.com/pre-commit/pre-commit-hooks
100+
rev: v4.6.0
101+
hooks:
102+
- id: trailing-whitespace
103+
# exclude autogenerated files
104+
exclude: /README\.rst$|\.pot?$
105+
- id: end-of-file-fixer
106+
# exclude autogenerated files
107+
exclude: /README\.rst$|\.pot?$
108+
- id: debug-statements
109+
- id: fix-encoding-pragma
110+
args: ["--remove"]
111+
- id: check-case-conflict
112+
- id: check-docstring-first
113+
- id: check-executables-have-shebangs
114+
- id: check-merge-conflict
115+
# exclude files where underlines are not distinguishable from merge conflicts
116+
exclude: /README\.rst$|^docs/.*\.rst$
117+
- id: check-symlinks
118+
- id: check-xml
119+
- id: mixed-line-ending
120+
args: ["--fix=lf"]
121+
- repo: https://github.com/astral-sh/ruff-pre-commit
122+
rev: v0.9.9
123+
hooks:
124+
- id: ruff
125+
args: [--fix, --exit-non-zero-on-fix]
126+
- id: ruff-format
127+
- repo: https://github.com/OCA/pylint-odoo
128+
rev: v9.3.2
129+
hooks:
130+
- id: pylint_odoo
131+
name: pylint with optional checks
132+
args:
133+
- --rcfile=.pylintrc
134+
- --exit-zero
135+
verbose: true
136+
- id: pylint_odoo
137+
args:
138+
- --rcfile=.pylintrc-mandatory

0 commit comments

Comments
 (0)