Skip to content

Commit bd5a03b

Browse files
[UPD] copier dotfiles
1 parent ac8af3e commit bd5a03b

13 files changed

+548
-67
lines changed

.copier-answers.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Do NOT update manually; changes here will be overwritten by Copier
2+
_commit: v1.14.2
3+
_src_path: https://github.com/OCA/oca-addons-repo-template.git
4+
ci: GitHub
5+
generate_requirements_txt: true
6+
github_check_license: false
7+
github_ci_extra_env: {}
8+
github_enable_codecov: true
9+
github_enable_makepot: true
10+
github_enable_stale_action: true
11+
github_enforce_dev_status_compatibility: false
12+
include_wkhtmltopdf: false
13+
odoo_version: 12.0
14+
org_name: Odoo Community Association (OCA)
15+
org_slug: OCA
16+
rebel_module_groups: []
17+
repo_description: Electronic Data Interchange modules
18+
repo_name: Electronic Data Interchange modules
19+
repo_slug: edi
20+
repo_website: https://github.com/OCA/edi
21+

.editorconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ indent_style = space
77
insert_final_newline = true
88
trim_trailing_whitespace = true
99

10-
[.eslintrc,*.{json,yml,yaml,rst,md}]
10+
[*.{json,yml,yaml,rst,md}]
1111
indent_size = 2
1212

1313
# Do not configure editor for libs and autogenerated content
14-
[*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst]
14+
[{*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst}]
1515
charset = unset
1616
end_of_line = unset
1717
indent_size = unset

.flake8

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[flake8]
2+
# E123,E133,E226,E241,E242 are ignored by default by pep8 and flake8
3+
# F811 is legal in odoo 8 when we implement 2 interfaces for a method
4+
# F601 pylint support this case with expected tests
5+
# W503 changed by W504 and OCA prefers allow both
6+
# E203: whitespace before ':' (black behaviour and not pep8 compliant)
7+
ignore = E123,E133,E226,E241,E242,F811,F601,W503,W504,E203
8+
max-line-length = 88
9+
per-file-ignores=
10+
__init__.py:F401
11+

.github/workflows/pre-commit.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "12.0*"
7+
push:
8+
branches:
9+
- "12.0"
10+
- "12.0-ocabot-*"
11+
12+
jobs:
13+
pre-commit:
14+
runs-on: ubuntu-20.04
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-python@v2
18+
with:
19+
python-version: "3.6"
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+
- name: Check that all files generated by pre-commit are in git
31+
run: |
32+
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
33+
if [ "$newfiles" != "" ] ; then
34+
echo "Please check-in the following files:"
35+
echo "$newfiles"
36+
exit 1
37+
fi

.github/workflows/stale.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Mark stale issues and pull requests
2+
3+
on:
4+
schedule:
5+
- cron: "0 12 * * 0"
6+
7+
jobs:
8+
stale:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Stale PRs and issues policy
12+
uses: actions/stale@v4
13+
with:
14+
repo-token: ${{ secrets.GITHUB_TOKEN }}
15+
# General settings.
16+
ascending: true
17+
remove-stale-when-updated: true
18+
# Pull Requests settings.
19+
# 120+30 day stale policy for PRs
20+
# * Except PRs marked as "no stale"
21+
days-before-pr-stale: 120
22+
days-before-pr-close: 30
23+
exempt-pr-labels: "no stale"
24+
stale-pr-label: "stale"
25+
stale-pr-message: >
26+
There hasn't been any activity on this pull request in the past 4 months, so
27+
it has been marked as stale and it will be closed automatically if no
28+
further activity occurs in the next 30 days.
29+
30+
If you want this PR to never become stale, please ask a PSC member to apply
31+
the "no stale" label.
32+
# Issues settings.
33+
# 180+30 day stale policy for open issues
34+
# * Except Issues marked as "no stale"
35+
days-before-issue-stale: 180
36+
days-before-issue-close: 30
37+
exempt-issue-labels: "no stale,needs more information"
38+
stale-issue-label: "stale"
39+
stale-issue-message: >
40+
There hasn't been any activity on this issue in the past 6 months, so it has
41+
been marked as stale and it will be closed automatically if no further
42+
activity occurs in the next 30 days.
43+
44+
If you want this issue to never become stale, please ask a PSC member to
45+
apply the "no stale" label.
46+
47+
# 15+30 day stale policy for issues pending more information
48+
# * Issues that are pending more information
49+
# * Except Issues marked as "no stale"
50+
- name: Needs more information stale issues policy
51+
uses: actions/stale@v4
52+
with:
53+
repo-token: ${{ secrets.GITHUB_TOKEN }}
54+
ascending: true
55+
only-labels: "needs more information"
56+
exempt-issue-labels: "no stale"
57+
days-before-stale: 15
58+
days-before-close: 30
59+
days-before-pr-stale: -1
60+
days-before-pr-close: -1
61+
remove-stale-when-updated: true
62+
stale-issue-label: "stale"
63+
stale-issue-message: >
64+
This issue needs more information and there hasn't been any activity
65+
recently, so it has been marked as stale and it will be closed automatically
66+
if no further activity occurs in the next 30 days.
67+
68+
If you think this is a mistake, please ask a PSC member to remove the "needs
69+
more information" label.

.github/workflows/test.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "12.0*"
7+
push:
8+
branches:
9+
- "12.0"
10+
- "12.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-20.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.6-odoo12.0:latest
39+
makepot: "true"
40+
name: test with Odoo
41+
- container: ghcr.io/oca/oca-ci/py3.6-ocb12.0:latest
42+
name: test with OCB
43+
services:
44+
postgres:
45+
image: postgres:9.6
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+
continue-on-error: true
61+
- name: Check development status
62+
run: manifestoo -d . check-dev-status --default-dev-status=Beta
63+
continue-on-error: true
64+
- name: Initialize test db
65+
run: oca_init_test_database
66+
- name: Run tests
67+
run: oca_run_tests
68+
- uses: codecov/codecov-action@v1
69+
- name: Update .pot files
70+
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
71+
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}

.gitignore

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
33
*.py[cod]
4+
/.venv
5+
/.pytest_cache
46

57
# C extensions
68
*.so
@@ -13,14 +15,14 @@ build/
1315
develop-eggs/
1416
dist/
1517
eggs/
16-
lib/
1718
lib64/
1819
parts/
1920
sdist/
2021
var/
2122
*.egg-info/
2223
.installed.cfg
2324
*.egg
25+
*.eggs
2426

2527
# Installer logs
2628
pip-log.txt
@@ -40,6 +42,19 @@ coverage.xml
4042
# Pycharm
4143
.idea
4244

45+
# Eclipse
46+
.settings
47+
48+
# Visual Studio cache/options directory
49+
.vs/
50+
.vscode
51+
52+
# OSX Files
53+
.DS_Store
54+
55+
# Django stuff:
56+
*.log
57+
4358
# Mr Developer
4459
.mr.developer.cfg
4560
.project
@@ -55,5 +70,5 @@ docs/_build/
5570
*~
5671
*.swp
5772

58-
# OSX Files
59-
*.DS_Store
73+
# OCA rules
74+
!static/lib/

.pre-commit-config.yaml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
# You don't usually want a bot to modify your legal texts
16+
(LICENSE.*|COPYING.*)
17+
default_language_version:
18+
python: python3.6
19+
repos:
20+
- repo: https://github.com/oca/maintainer-tools
21+
rev: ab1d7f6
22+
hooks:
23+
# update the NOT INSTALLABLE ADDONS section above
24+
- id: oca-update-pre-commit-excluded-addons
25+
- id: oca-fix-manifest-website
26+
args: ["https://github.com/OCA/edi"]
27+
- repo: https://github.com/acsone/setuptools-odoo
28+
rev: 3.1.8
29+
hooks:
30+
- id: setuptools-odoo-make-default
31+
- id: setuptools-odoo-get-requirements
32+
args:
33+
- --output
34+
- requirements.txt
35+
- --header
36+
- "# generated from manifests external_dependencies"
37+
- repo: https://github.com/OCA/mirrors-flake8
38+
rev: v3.4.1
39+
hooks:
40+
- id: flake8
41+
name: flake8 excluding __init__.py
42+
exclude: __init__\.py
43+
- repo: https://github.com/pre-commit/mirrors-pylint
44+
rev: v2.5.3
45+
hooks:
46+
- id: pylint
47+
name: pylint with optional checks
48+
args:
49+
- --rcfile=.pylintrc
50+
- --exit-zero
51+
verbose: true
52+
additional_dependencies: &pylint_deps
53+
- pylint-odoo==3.5.0
54+
- id: pylint
55+
name: pylint with mandatory checks
56+
args:
57+
- --rcfile=.pylintrc-mandatory
58+
additional_dependencies: *pylint_deps
59+

0 commit comments

Comments
 (0)