Skip to content

Commit feacd10

Browse files
authored
[IMP] pylint_odoo: apocalintSYS - Full refactoring - v8.0.0 (#396)
- Remove checks already migrated to oca-odoo-pre-commit-hooks - Remove deprecated checks - Remove py2 compatibility or dual old pylint compatibility - Migrate CI to github actions instead of travis-CI - Add MACOS environments to CI - Remove pbr dependency using setup.py out-of-the-box Rename master branch to main (github fashion) - Fix DeprecationWarning: Please use rfc3986.validators.Validator instead. This method will be eventually removed. Rename packages paths: - pylint_odoo -> src/pylint_odoo (Based on popular templates) - pylint_odoo/test* -> test* (The tests and theirs resources are not part of the package) Add tox in order to run tests in isolated way and parallels - Add bump2version - Bump version: 7.0.4 → 8.0.0 Fix #259 Fix #264 Fix #267 Fix #277 Fix #380 Fix #381 Fix #393 Fix #328 Related to OCA/maintainer-quality-tools#623 (comment) Closes #329 Related to https://github.com/OCA/odoo-pre-commit-hooks
1 parent 12374c1 commit feacd10

File tree

142 files changed

+1421
-2454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+1421
-2454
lines changed

.bumpversion.cfg

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[bumpversion]
2+
current_version = 8.0.0
3+
commit = True
4+
tag = True
5+
sign_tags = True
6+
7+
[bumpversion:file:setup.cfg]
8+
search = version = {current_version}
9+
replace = version = {new_version}
10+
11+
[bumpversion:file:src/pylint_odoo/__init__.py]
12+
search = __version__ = "{current_version}"
13+
replace = __version__ = "{new_version}"

.coveragerc

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1-
# Config file .coveragerc
1+
[paths]
2+
source = src
23

3-
[report]
4-
include =
5-
pylint_odoo/*
4+
[run]
5+
source = src
6+
parallel = true
7+
dynamic_context = test_function
8+
context = ${{COVERAGE_CONTEXT}}
69

10+
[report]
11+
show_missing = true
12+
precision = 2
13+
# fail_under = 98
714
omit =
8-
*/test_repo/*
915
*__init__.py
10-
*__openerp__.py
16+
*/tests/*
17+
*__main__.py
1118

1219
# Regexes for lines to exclude from consideration
1320
exclude_lines =
21+
# Have to re-enable the standard pragma
1422
pragma: no cover
15-
# Don't complain about self-execute
16-
if __name__ == '__main__':
17-
# Don't complain about uninstalled packages
18-
except OSError as oserr:
19-
except NameError:
20-
except SyntaxError:
23+
# tests import the package instead
24+
if __name__ == "__main__":
25+
26+
[html]
27+
show_contexts=True

.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

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

.flake8

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[flake8]
2+
max-line-length = 119
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
11+
per-file-ignores=
12+
__init__.py:F401

.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.

0 commit comments

Comments
 (0)