Skip to content

Commit

Permalink
Merge pull request #17 from coopiteasy/12.0-template
Browse files Browse the repository at this point in the history
12.0 template
  • Loading branch information
carmenbianca authored May 16, 2022
2 parents 5793cf2 + 02601de commit 48c0097
Show file tree
Hide file tree
Showing 21 changed files with 339 additions and 210 deletions.
12 changes: 8 additions & 4 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.1.1
_src_path: gh:oca/oca-addons-repo-template
dependency_installation_mode: PIP
_commit: v2.0.10
_src_path: https://github.com/coopiteasy/oca-addons-repo-template.git
ci: GitHub
dependency_installation_mode: OCA
generate_requirements_txt: true
include_wkhtmltopdf: false
odoo_version: 12.0
org_name: Coop IT Easy SCRLfs
org_slug: coopiteasy
rebel_module_groups: []
repo_description: "TODO: add repo description."
repo_description: hr_timesheet modules
repo_name: cie-timesheet
repo_slug: cie-timesheet
repo_website: https://coopiteasy.be
travis_apt_packages: []
travis_apt_sources: []
11 changes: 9 additions & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
env:
browser: true
es6: true

# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
parserOptions:
ecmaVersion: 2017
ecmaVersion: 2019

overrides:
- files:
- "**/*.esm.js"
parserOptions:
sourceType: module

# Globals available in Odoo that shouldn't produce errorings
globals:
Expand All @@ -14,7 +21,7 @@ globals:
moment: readonly
odoo: readonly
openerp: readonly
Promise: readonly
owl: readonly

# Styling is handled by Prettier, so we only need to enable AST rules;
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
Expand Down
18 changes: 9 additions & 9 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[flake8]
max-line-length = 80
max-complexity = 16
# B = bugbear
# B9 = bugbear opinionated (incl line length)
select = C,E,F,W,B,B9
# E203: whitespace before ':' (black behaviour)
# E501: flake8 line length (covered by bugbear B950)
# W503: line break before binary operator (black behaviour)
ignore = E203,E501,W503
# E123,E133,E226,E241,E242 are ignored by default by pep8 and flake8
# F811 is legal in odoo 8 when we implement 2 interfaces for a method
# F601 pylint support this case with expected tests
# W503 changed by W504 and OCA prefers allow both
# E203: whitespace before ':' (black behaviour and not pep8 compliant)
ignore = E123,E133,E226,E241,E242,F811,F601,W503,W504,E203
max-line-length = 88
per-file-ignores=
__init__.py:F401
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Description



## Odoo task (if applicable)



## Checklist before approval

- [ ] Tests are present (or not needed).
- [ ] Credits/copyright have been changed correctly.
- [ ] (If a new module) Moving this to OCA has been considered.
35 changes: 35 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: pre-commit

on:
pull_request:
branches:
- "12.0*"
push:
branches:
- "12.0"
- "12.0-ocabot-*"

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Get python version
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v1
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure --color=always
- name: Check that all files generated by pre-commit are in git
run: |
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
if [ "$newfiles" != "" ] ; then
echo "Please check-in the following files:"
echo "$newfiles"
exit 1
fi
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: tests

on:
pull_request:
branches:
- "12.0*"
push:
branches:
- "12.0"
- "12.0-ocabot-*"

jobs:
test:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.6-ocb12.0:latest
makepot: "true"
name: test with OCB
services:
postgres:
image: postgres:9.6
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
POSTGRES_DB: odoo
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install addons and dependencies
run: oca_install_addons
- name: Check licenses
run: manifestoo -d . check-licenses
- name: Check development status
run: manifestoo -d . check-dev-status --default-dev-status=Beta
- name: Initialize test db
run: oca_init_test_database
- name: Run tests
run: oca_run_tests
- uses: codecov/codecov-action@v1
- name: Update .pot files
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'coopiteasy' }}
3 changes: 2 additions & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ include_trailing_comma=True
force_grid_wrap=0
combine_as_imports=True
use_parentheses=True
line_length=79
line_length=88
known_odoo=odoo
known_odoo_addons=odoo.addons
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER
default_section=THIRDPARTY
ensure_newline_before_comments = True
69 changes: 35 additions & 34 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exclude: |
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
# We don't want to mess with tool-generated files
.svg$|
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
# Maybe reactivate this when all README files include prettier ignore tags?
^README\.md$|
# Library files can have extraneous formatting (even minimized)
Expand Down Expand Up @@ -37,31 +37,38 @@ repos:
rev: v1.4
hooks:
- id: autoflake
args: ["-i", "--ignore-init-module-imports"]
args:
- --expand-star-imports
- --ignore-init-module-imports
- --in-place
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
additional_dependencies: ["click<8.1.0"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.1.2
rev: v2.4.1
hooks:
- id: prettier
name: prettier + plugin-xml
name: prettier (with plugin-xml)
entry: prettier --write --list-different
additional_dependencies:
- "prettier@2.1.2"
- "@prettier/plugin-xml@0.12.0"
- "prettier@2.4.1"
- "@prettier/plugin-xml@1.1.0"
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v6.8.0
hooks:
- id: eslint
verbose: true
args:
- --plugin=@prettier/plugin-xml
# - repo: https://github.com/pre-commit/mirrors-eslint
# rev: v7.8.1
# hooks:
# - id: eslint
# verbose: true
# args:
# - --color
# - --fix
- --color
- --fix
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v2.4.0
hooks:
- id: trailing-whitespace
# exclude autogenerated files
Expand All @@ -83,19 +90,18 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
rev: v1.26.2
hooks:
- id: pyupgrade
- repo: https://github.com/PyCQA/isort
rev: 5.5.1
args: ["--keep-percent-format"]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
name: isort except __init__.py
args:
- --settings=.
exclude: /__init__\.py$
- repo: https://github.com/acsone/setuptools-odoo
rev: 2.6.0
rev: 3.0.6
hooks:
- id: setuptools-odoo-make-default
- id: setuptools-odoo-get-requirements
Expand All @@ -104,20 +110,15 @@ repos:
- requirements.txt
- --header
- "# generated from manifests external_dependencies"
- repo: https://gitlab.com/PyCQA/flake8
rev: 3.8.3
- repo: https://github.com/OCA/mirrors-flake8
rev: v3.7.9
hooks:
- id: flake8
name: flake8 except __init__.py
exclude: /__init__\.py$
additional_dependencies: ["flake8-bugbear==20.1.4"]
- id: flake8
name: flake8 only __init__.py
args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
files: /__init__\.py$
additional_dependencies: ["flake8-bugbear==20.1.4"]
language_version: python3
name: flake8 excluding __init__.py
exclude: __init__\.py
- repo: https://github.com/PyCQA/pylint
rev: pylint-2.5.3
rev: v2.11.1
hooks:
- id: pylint
name: pylint with optional checks
Expand All @@ -126,7 +127,7 @@ repos:
- --exit-zero
verbose: true
additional_dependencies: &pylint_deps
- pylint-odoo==3.5.0
- pylint-odoo==5.0.5
- id: pylint
name: pylint with mandatory checks
args:
Expand Down
Loading

0 comments on commit 48c0097

Please sign in to comment.