Skip to content

Commit 00f8b14

Browse files
author
Jairo Llopis
committed
Hello world 🖖
Support only v13 for now. Includes instructions and CI.
1 parent c1fcda0 commit 00f8b14

30 files changed

+2586
-0
lines changed

‎.editorconfig

+20
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

‎.eslintrc.yml

+180
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
env:
2+
browser: true
3+
4+
# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
5+
parserOptions:
6+
ecmaVersion: 2017
7+
8+
# Globals available in Odoo that shouldn't produce errorings
9+
globals:
10+
_: readonly
11+
$: readonly
12+
fuzzy: readonly
13+
jQuery: readonly
14+
moment: readonly
15+
odoo: readonly
16+
openerp: readonly
17+
Promise: readonly
18+
19+
# Styling is handled by Prettier, so we only need to enable AST rules;
20+
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
21+
rules:
22+
accessor-pairs: warn
23+
array-callback-return: warn
24+
callback-return: warn
25+
capitalized-comments:
26+
- warn
27+
- always
28+
- ignoreConsecutiveComments: true
29+
ignoreInlineComments: true
30+
complexity:
31+
- warn
32+
- 15
33+
constructor-super: warn
34+
dot-notation: warn
35+
eqeqeq: warn
36+
global-require: warn
37+
handle-callback-err: warn
38+
id-blacklist: warn
39+
id-match: warn
40+
init-declarations: error
41+
max-depth: warn
42+
max-nested-callbacks: warn
43+
max-statements-per-line: warn
44+
no-alert: warn
45+
no-array-constructor: warn
46+
no-caller: warn
47+
no-case-declarations: warn
48+
no-class-assign: warn
49+
no-cond-assign: error
50+
no-const-assign: error
51+
no-constant-condition: warn
52+
no-control-regex: warn
53+
no-debugger: error
54+
no-delete-var: warn
55+
no-div-regex: warn
56+
no-dupe-args: error
57+
no-dupe-class-members: error
58+
no-dupe-keys: error
59+
no-duplicate-case: error
60+
no-duplicate-imports: error
61+
no-else-return: warn
62+
no-empty-character-class: warn
63+
no-empty-function: error
64+
no-empty-pattern: error
65+
no-empty: warn
66+
no-eq-null: error
67+
no-eval: error
68+
no-ex-assign: error
69+
no-extend-native: warn
70+
no-extra-bind: warn
71+
no-extra-boolean-cast: warn
72+
no-extra-label: warn
73+
no-fallthrough: warn
74+
no-func-assign: error
75+
no-global-assign: error
76+
no-implicit-coercion:
77+
- warn
78+
- allow: ["~"]
79+
no-implicit-globals: warn
80+
no-implied-eval: warn
81+
no-inline-comments: warn
82+
no-inner-declarations: warn
83+
no-invalid-regexp: warn
84+
no-irregular-whitespace: warn
85+
no-iterator: warn
86+
no-label-var: warn
87+
no-labels: warn
88+
no-lone-blocks: warn
89+
no-lonely-if: error
90+
no-mixed-requires: error
91+
no-multi-str: warn
92+
no-native-reassign: error
93+
no-negated-condition: warn
94+
no-negated-in-lhs: error
95+
no-new-func: warn
96+
no-new-object: warn
97+
no-new-require: warn
98+
no-new-symbol: warn
99+
no-new-wrappers: warn
100+
no-new: warn
101+
no-obj-calls: warn
102+
no-octal-escape: warn
103+
no-octal: warn
104+
no-param-reassign: warn
105+
no-path-concat: warn
106+
no-process-env: warn
107+
no-process-exit: warn
108+
no-proto: warn
109+
no-prototype-builtins: warn
110+
no-redeclare: warn
111+
no-regex-spaces: warn
112+
no-restricted-globals: warn
113+
no-restricted-imports: warn
114+
no-restricted-modules: warn
115+
no-restricted-syntax: warn
116+
no-return-assign: error
117+
no-script-url: warn
118+
no-self-assign: warn
119+
no-self-compare: warn
120+
no-sequences: warn
121+
no-shadow-restricted-names: warn
122+
no-shadow: warn
123+
no-sparse-arrays: warn
124+
no-sync: warn
125+
no-this-before-super: warn
126+
no-throw-literal: warn
127+
no-undef-init: warn
128+
no-undef: error
129+
no-unmodified-loop-condition: warn
130+
no-unneeded-ternary: error
131+
no-unreachable: error
132+
no-unsafe-finally: error
133+
no-unused-expressions: error
134+
no-unused-labels: error
135+
no-unused-vars: error
136+
no-use-before-define: error
137+
no-useless-call: warn
138+
no-useless-computed-key: warn
139+
no-useless-concat: warn
140+
no-useless-constructor: warn
141+
no-useless-escape: warn
142+
no-useless-rename: warn
143+
no-void: warn
144+
no-with: warn
145+
operator-assignment: [error, always]
146+
prefer-const: warn
147+
radix: warn
148+
require-yield: warn
149+
sort-imports: warn
150+
spaced-comment: [error, always]
151+
strict: [error, function]
152+
use-isnan: error
153+
valid-jsdoc:
154+
- warn
155+
- prefer:
156+
arg: param
157+
argument: param
158+
augments: extends
159+
constructor: class
160+
exception: throws
161+
func: function
162+
method: function
163+
prop: property
164+
return: returns
165+
virtual: abstract
166+
yield: yields
167+
preferType:
168+
array: Array
169+
bool: Boolean
170+
boolean: Boolean
171+
number: Number
172+
object: Object
173+
str: String
174+
string: String
175+
requireParamDescription: false
176+
requireReturn: false
177+
requireReturnDescription: false
178+
requireReturnType: false
179+
valid-typeof: warn
180+
yoda: warn

‎.flake8

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[flake8]
2+
max-line-length = 80
3+
max-complexity = 16
4+
# B = bugbear
5+
# B9 = bugbear opinionated (incl line length)
6+
select = C,E,F,W,B,B9
7+
# E203: whitespace before ':' (black behaviour)
8+
# E501: flake8 line length (covered by bugbear B950)
9+
# W503: line break before binary operator (black behaviour)
10+
ignore = E203,E501,W503

‎.github/workflows/automerge.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: automerge
2+
on:
3+
pull_request:
4+
types:
5+
- edited
6+
- labeled
7+
- opened
8+
- ready_for_review
9+
- reopened
10+
- synchronize
11+
- unlabeled
12+
- unlocked
13+
pull_request_review:
14+
types:
15+
- submitted
16+
status: {}
17+
jobs:
18+
automerge:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: automerge
22+
uses: "pascalgn/automerge-action@v0.7.5"
23+
env:
24+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
25+
MERGE_DELETE_BRANCH: "true"
26+
MERGE_LABELS: "automerge,!work in progress"
27+
MERGE_METHOD: "rebase"
28+
# Disable autorebasing PRs because they cannot retrigger checks
29+
UPDATE_LABELS: ""
30+
UPDATE_METHOD: "rebase"
31+
# Retry for 30 minutes
32+
MERGE_RETRIES: 30
33+
MERGE_RETRY_SLEEP: 60000

‎.github/workflows/lint.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
pre-commit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-python@v1
16+
- name: set PY
17+
run:
18+
echo "::set-env name=PY::$(python -c 'import hashlib,
19+
sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
20+
- uses: actions/cache@v1
21+
with:
22+
path: ~/.cache/pre-commit
23+
key: pre-commit ${{ env.PY }} ${{ hashFiles('.pre-commit-config.yaml') }}
24+
- uses: pre-commit/action@v1.1.0

‎.github/workflows/test.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
odoo-version:
16+
- 13.0
17+
steps:
18+
# Prepare environment
19+
- uses: actions/checkout@v1
20+
- name: Install python
21+
uses: actions/setup-python@v1
22+
- name: Patch $PATH
23+
run: echo "::set-env name=PATH::$HOME/.local/bin:$PATH"
24+
- run: pip install pipx
25+
- run: pipx install poetry
26+
- name: Generate cache key PY
27+
run:
28+
echo "::set-env name=PY::${{ runner.os }} python -VV | sha256sum) $(pipx
29+
--version | sha256sum) $(poetry --version | sha256sum) ${{
30+
hashFiles('pyproject.toml') }} ${{ hashFiles('poetry.lock') }}"
31+
- uses: actions/cache@v1
32+
with:
33+
path: ~/.cache
34+
key: cache ${{ env.PY }}
35+
- uses: actions/cache@v1
36+
with:
37+
path: ~/.local
38+
key: local ${{ env.PY }}
39+
- run: poetry install
40+
41+
# Let tests issue git commits
42+
- run: git config --global user.name CI
43+
- run: git config --global user.email CI@GITHUB
44+
45+
# Run all tests
46+
- run: poetry run pytest --color yes
47+
env:
48+
SELECTED_ODOO_VERSIONS: ${{ matrix.odoo-version }}

0 commit comments

Comments
 (0)