Skip to content

Commit 7f1e939

Browse files
committed
Initial commit
0 parents  commit 7f1e939

File tree

9 files changed

+623
-0
lines changed

9 files changed

+623
-0
lines changed

.copier-answers.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Do NOT update manually; changes here will be overwritten by Copier
2+
_commit: v1.18
3+
_src_path: https://github.com/OCA/oca-addons-repo-template.git
4+
additional_ruff_rules: []
5+
ci: GitHub
6+
generate_requirements_txt: true
7+
github_check_license: true
8+
github_ci_extra_env: {}
9+
github_enable_codecov: true
10+
github_enable_makepot: true
11+
github_enable_stale_action: true
12+
github_enforce_dev_status_compatibility: true
13+
include_wkhtmltopdf: false
14+
odoo_test_flavor: Both
15+
odoo_version: 17.0
16+
org_name: Odoo Community Association (OCA)
17+
org_slug: OCA
18+
rebel_module_groups: []
19+
repo_description: Modules that expand the Odoo spreadsheets features.
20+
repo_name: Spreadsheet modules for Odoo
21+
repo_slug: spreadsheet
22+
repo_website: https://github.com/OCA/spreadsheet
23+
use_pyproject_toml: true
24+
use_ruff: true
25+

.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+
- "17.0*"
7+
push:
8+
branches:
9+
- "17.0"
10+
- "17.0-ocabot-*"
11+
12+
jobs:
13+
pre-commit:
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v2
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@v1
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: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "17.0*"
7+
push:
8+
branches:
9+
- "17.0"
10+
- "17.0-ocabot-*"
11+
12+
jobs:
13+
unreleased-deps:
14+
runs-on: ubuntu-latest
15+
name: Detect unreleased dependencies
16+
steps:
17+
- uses: actions/checkout@v3
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-odoo17.0:latest
39+
name: test with Odoo
40+
- container: ghcr.io/oca/oca-ci/py3.10-ocb17.0:latest
41+
name: test with OCB
42+
makepot: "true"
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@v3
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+
- name: Initialize test db
63+
run: oca_init_test_database
64+
- name: Run tests
65+
run: oca_run_tests
66+
- uses: codecov/codecov-action@v1
67+
- name: Update .pot files
68+
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
69+
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}

.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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+
# Installer logs
29+
pip-log.txt
30+
pip-delete-this-directory.txt
31+
32+
# Unit test / coverage reports
33+
htmlcov/
34+
.tox/
35+
.coverage
36+
.cache
37+
nosetests.xml
38+
coverage.xml
39+
40+
# Translations
41+
*.mo
42+
43+
# Pycharm
44+
.idea
45+
46+
# Eclipse
47+
.settings
48+
49+
# Visual Studio cache/options directory
50+
.vs/
51+
.vscode
52+
53+
# OSX Files
54+
.DS_Store
55+
56+
# Django stuff:
57+
*.log
58+
59+
# Mr Developer
60+
.mr.developer.cfg
61+
.project
62+
.pydevproject
63+
64+
# Rope
65+
.ropeproject
66+
67+
# Sphinx documentation
68+
docs/_build/
69+
70+
# Backup files
71+
*~
72+
*.swp
73+
74+
# OCA rules
75+
!static/lib/

.pre-commit-config.yaml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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/|
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+
# You don't usually want a bot to modify your legal texts
20+
(LICENSE.*|COPYING.*)
21+
default_language_version:
22+
python: python3
23+
node: "16.17.0"
24+
repos:
25+
- repo: local
26+
hooks:
27+
# These files are most likely copier diff rejection junks; if found,
28+
# review them manually, fix the problem (if needed) and remove them
29+
- id: forbidden-files
30+
name: forbidden files
31+
entry: found forbidden files; remove them
32+
language: fail
33+
files: "\\.rej$"
34+
- id: en-po-files
35+
name: en.po files cannot exist
36+
entry: found a en.po file
37+
language: fail
38+
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
39+
- repo: https://github.com/sbidoul/whool
40+
rev: v0.5
41+
hooks:
42+
- id: whool-init
43+
- repo: https://github.com/oca/maintainer-tools
44+
rev: 568cacd1d6eef453063a524a5ce63dcd49c7259b
45+
hooks:
46+
# update the NOT INSTALLABLE ADDONS section above
47+
- id: oca-update-pre-commit-excluded-addons
48+
- id: oca-fix-manifest-website
49+
args: ["https://github.com/OCA/spreadsheet"]
50+
- id: oca-gen-addon-readme
51+
args:
52+
- --addons-dir=.
53+
- --branch=17.0
54+
- --org-name=OCA
55+
- --repo-name=spreadsheet
56+
- --if-source-changed
57+
- id: oca-gen-external-dependencies
58+
- repo: https://github.com/OCA/odoo-pre-commit-hooks
59+
rev: v0.0.25
60+
hooks:
61+
- id: oca-checks-odoo-module
62+
- id: oca-checks-po
63+
- repo: https://github.com/pre-commit/mirrors-prettier
64+
rev: v2.7.1
65+
hooks:
66+
- id: prettier
67+
name: prettier (with plugin-xml)
68+
additional_dependencies:
69+
- "prettier@2.7.1"
70+
- "@prettier/plugin-xml@2.2.0"
71+
args:
72+
- --plugin=@prettier/plugin-xml
73+
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
74+
- repo: https://github.com/pre-commit/mirrors-eslint
75+
rev: v8.24.0
76+
hooks:
77+
- id: eslint
78+
verbose: true
79+
args:
80+
- --color
81+
- --fix
82+
- repo: https://github.com/pre-commit/pre-commit-hooks
83+
rev: v4.3.0
84+
hooks:
85+
- id: trailing-whitespace
86+
# exclude autogenerated files
87+
exclude: /README\.rst$|\.pot?$
88+
- id: end-of-file-fixer
89+
# exclude autogenerated files
90+
exclude: /README\.rst$|\.pot?$
91+
- id: debug-statements
92+
- id: fix-encoding-pragma
93+
args: ["--remove"]
94+
- id: check-case-conflict
95+
- id: check-docstring-first
96+
- id: check-executables-have-shebangs
97+
- id: check-merge-conflict
98+
# exclude files where underlines are not distinguishable from merge conflicts
99+
exclude: /README\.rst$|^docs/.*\.rst$
100+
- id: check-symlinks
101+
- id: check-xml
102+
- id: mixed-line-ending
103+
args: ["--fix=lf"]
104+
- repo: https://github.com/astral-sh/ruff-pre-commit
105+
rev: v0.1.3
106+
hooks:
107+
- id: ruff
108+
args: [--fix, --exit-non-zero-on-fix]
109+
- id: ruff-format
110+
- repo: https://github.com/OCA/pylint-odoo
111+
rev: v8.0.19
112+
hooks:
113+
- id: pylint_odoo
114+
name: pylint with optional checks
115+
args:
116+
- --rcfile=.pylintrc
117+
- --exit-zero
118+
verbose: true
119+
- id: pylint_odoo
120+
args:
121+
- --rcfile=.pylintrc-mandatory

0 commit comments

Comments
 (0)