Skip to content

Commit a7ef1ff

Browse files
committed
Initial metafiles
0 parents  commit a7ef1ff

14 files changed

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

.gitignore

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
env/
11+
bin/
12+
build/
13+
develop-eggs/
14+
dist/
15+
eggs/
16+
lib/
17+
lib64/
18+
parts/
19+
sdist/
20+
var/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
25+
# Installer logs
26+
pip-log.txt
27+
pip-delete-this-directory.txt
28+
29+
# Unit test / coverage reports
30+
htmlcov/
31+
.tox/
32+
.coverage
33+
.cache
34+
nosetests.xml
35+
coverage.xml
36+
37+
# Translations
38+
*.mo
39+
40+
# Pycharm
41+
.idea
42+
43+
# Visual Studio cache/options directory
44+
.vs/
45+
.vscode
46+
47+
# Mr Developer
48+
.mr.developer.cfg
49+
.project
50+
.pydevproject
51+
52+
# Rope
53+
.ropeproject
54+
55+
# Sphinx documentation
56+
docs/_build/
57+
58+
# Backup files
59+
*~
60+
*.swp

.isort.cfg

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[settings]
2+
; see https://github.com/psf/black
3+
multi_line_output=3
4+
include_trailing_comma=True
5+
force_grid_wrap=0
6+
combine_as_imports=True
7+
use_parentheses=True
8+
line_length=88
9+
known_odoo=odoo
10+
known_odoo_addons=odoo.addons
11+
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER
12+
default_section=THIRDPARTY

.pre-commit-config.yaml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
exclude: |
2+
(?x)
3+
# Files and folders generated by bots, to avoid loops
4+
^setup/|/static/description/index\.html$|
5+
# Maybe reactivate this when all README files include prettier ignore tags?
6+
^README\.md$|
7+
# Library files can have extraneous formatting (even minimized)
8+
/static/(src/)?lib/|
9+
# Repos using Sphinx to generate docs don't need prettying
10+
^docs/_templates/.*\.html$|
11+
# You don't usually want a bot to modify your legal texts
12+
(LICENSE.*|COPYING.*)
13+
default_language_version:
14+
python: python3
15+
repos:
16+
- repo: https://github.com/psf/black
17+
rev: 19.10b0
18+
hooks:
19+
- id: black
20+
- repo: https://github.com/prettier/prettier
21+
rev: "1.19.1"
22+
hooks:
23+
- id: prettier
24+
# TODO Avoid awebdeveloper/pre-commit-prettier if possible
25+
# HACK https://github.com/prettier/prettier/issues/7407
26+
- repo: https://github.com/awebdeveloper/pre-commit-prettier
27+
rev: v0.0.1
28+
hooks:
29+
- id: prettier
30+
name: prettier xml plugin
31+
additional_dependencies:
32+
33+
- "@prettier/[email protected]"
34+
files: \.xml$
35+
- repo: https://github.com/pre-commit/mirrors-eslint
36+
rev: v6.8.0
37+
hooks:
38+
- id: eslint
39+
verbose: true
40+
args:
41+
- --color
42+
- --fix
43+
- repo: https://github.com/pre-commit/pre-commit-hooks
44+
rev: v2.4.0
45+
hooks:
46+
- id: trailing-whitespace
47+
# exclude autogenerated files
48+
exclude: /README\.rst$|\.pot?$
49+
- id: end-of-file-fixer
50+
# exclude autogenerated files
51+
exclude: /README\.rst$|\.pot?$
52+
- id: debug-statements
53+
- id: fix-encoding-pragma
54+
args: ["--remove"]
55+
- id: check-case-conflict
56+
- id: check-docstring-first
57+
- id: check-executables-have-shebangs
58+
- id: check-merge-conflict
59+
# exclude files where underlines are not distinguishable from merge conflicts
60+
exclude: /README\.rst$|^docs/.*\.rst$
61+
- id: check-symlinks
62+
- id: check-xml
63+
- id: mixed-line-ending
64+
args: ["--fix=lf"]
65+
- repo: https://gitlab.com/pycqa/flake8
66+
rev: 3.7.9
67+
hooks:
68+
- id: flake8
69+
name: flake8 except __init__.py
70+
exclude: /__init__\.py$
71+
additional_dependencies: ["flake8-bugbear==19.8.0"]
72+
- id: flake8
73+
name: flake8 only __init__.py
74+
args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
75+
files: /__init__\.py$
76+
additional_dependencies: ["flake8-bugbear==19.8.0"]
77+
- repo: https://github.com/pre-commit/mirrors-pylint
78+
rev: v2.3.1
79+
hooks:
80+
- id: pylint
81+
name: pylint with optional checks
82+
args: ["--rcfile=.pylintrc", "--exit-zero"]
83+
verbose: true
84+
additional_dependencies: ["pylint-odoo==3.1.0"]
85+
- id: pylint
86+
name: pylint with mandatory checks
87+
args: ["--rcfile=.pylintrc-mandatory"]
88+
additional_dependencies: ["pylint-odoo==3.1.0"]
89+
- repo: https://github.com/asottile/pyupgrade
90+
rev: v1.26.2
91+
hooks:
92+
- id: pyupgrade
93+
- repo: https://github.com/pre-commit/mirrors-isort
94+
rev: v4.3.21
95+
hooks:
96+
- id: isort
97+
name: isort except __init__.py
98+
exclude: /__init__\.py$
99+
- repo: https://github.com/acsone/setuptools-odoo
100+
rev: 2.5.2
101+
hooks:
102+
- id: setuptools-odoo-make-default

.prettierrc.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Defaults for all prettier-supported languages.
2+
# Prettier will complete this with settings from .editorconfig file.
3+
bracketSpacing: false
4+
printWidth: 88
5+
proseWrap: always
6+
semi: true
7+
trailingComma: "es5"
8+
xmlWhitespaceSensitivity: "ignore"

0 commit comments

Comments
 (0)