Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Odoo scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo scripts
Commits
587f1c60
Commit
587f1c60
authored
2 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
make the pylint format an option
parent
de54bc07
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!170
✨ make the pylint format an option
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NEWS.rst
+1
-1
1 addition, 1 deletion
NEWS.rst
odoo_scripts/docker_pylint.py
+16
-3
16 additions, 3 deletions
odoo_scripts/docker_pylint.py
with
17 additions
and
4 deletions
NEWS.rst
+
1
−
1
View file @
587f1c60
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
18.1.0
18.1.0
------
------
Use
pylint colorized output.
Add
pylint
output format option and default to a
colorized output.
18.0.1
18.0.1
------
------
...
...
This diff is collapsed.
Click to expand it.
odoo_scripts/docker_pylint.py
+
16
−
3
View file @
587f1c60
...
@@ -52,8 +52,15 @@
...
@@ -52,8 +52,15 @@
default
=
[],
default
=
[],
nargs
=
"
+
"
,
nargs
=
"
+
"
,
)
)
parser
.
add_argument
(
"
--pylint-output-format
"
,
help
=
"
Run pylint with the --output-format provided (for example colorized or
"
"
parseable)
"
,
dest
=
"
pylint_output_format
"
,
default
=
"
colorized
"
,
)
def
apply_pylint
(
namespace
:
argparse
.
Namespace
)
->
int
:
def
apply_pylint
(
namespace
:
argparse
.
Namespace
)
->
int
:
"""
Run pylint if the option was set.
"""
"""
Run pylint if the option was set.
"""
if
_PYLINT_DEST
in
namespace
and
getattr
(
namespace
,
_PYLINT_DEST
):
if
_PYLINT_DEST
in
namespace
and
getattr
(
namespace
,
_PYLINT_DEST
):
...
@@ -55,9 +62,13 @@
...
@@ -55,9 +62,13 @@
def
apply_pylint
(
namespace
:
argparse
.
Namespace
)
->
int
:
def
apply_pylint
(
namespace
:
argparse
.
Namespace
)
->
int
:
"""
Run pylint if the option was set.
"""
"""
Run pylint if the option was set.
"""
if
_PYLINT_DEST
in
namespace
and
getattr
(
namespace
,
_PYLINT_DEST
):
if
_PYLINT_DEST
in
namespace
and
getattr
(
namespace
,
_PYLINT_DEST
):
return
pylint
(
getattr
(
namespace
,
_PYLINT_DEST
),
get_build_options
(
namespace
))
return
pylint
(
getattr
(
namespace
,
_PYLINT_DEST
),
get_build_options
(
namespace
),
namespace
.
pylint_output_format
,
)
return
0
return
0
...
@@ -71,7 +82,9 @@
...
@@ -71,7 +82,9 @@
return
apply_pylint
(
nmspc
)
return
apply_pylint
(
nmspc
)
def
pylint
(
modules
:
List
[
str
],
build_options
:
List
[
str
]):
def
pylint
(
modules
:
List
[
str
],
build_options
:
List
[
str
],
output_format
:
str
=
"
colorized
"
):
"""
Run pylint
"""
"""
Run pylint
"""
config
=
Config
()
config
=
Config
()
mounts
:
List
[
Mount
]
mounts
:
List
[
Mount
]
...
@@ -96,7 +109,7 @@
...
@@ -96,7 +109,7 @@
config
.
local_tag
,
config
.
local_tag
,
{
{
"
entrypoint
"
:
"
pylint
"
,
"
entrypoint
"
:
"
pylint
"
,
"
command
"
:
[
"
--output-format=
colorized
"
]
+
modules
,
"
command
"
:
[
f
"
--output-format=
{
output_format
}
"
]
+
modules
,
# needed to write in the cache
# needed to write in the cache
"
user
"
:
"
root
"
,
"
user
"
:
"
root
"
,
"
mounts
"
:
mounts
,
"
mounts
"
:
mounts
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment