Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bioneland
Splito
Commits
21ee9cbc
Commit
21ee9cbc
authored
Oct 30, 2020
by
Tanguy Le Carrour
Browse files
Add common tasks.
parent
53aeae2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
tasks/__init__.py
0 → 100644
View file @
21ee9cbc
from
invoke
import
task
,
Collection
# type: ignore
import
tasks.test
from
tasks.helpers
import
title
@
task
()
def
format
(
c
):
"""Format code"""
title
(
format
.
__doc__
)
c
.
run
(
"black splito tasks"
)
@
task
()
def
security
(
c
):
"""Check code security issues."""
title
(
security
.
__doc__
)
c
.
run
(
"safety check"
)
ns
=
Collection
()
ns
.
add_task
(
format
)
ns
.
add_task
(
security
)
ns
.
add_collection
(
tasks
.
test
)
tasks/helpers.py
0 → 100644
View file @
21ee9cbc
from
termcolor
import
cprint
def
title
(
message
:
str
)
->
None
:
cprint
(
"
\n
* {}"
.
format
(
message
),
"blue"
)
tasks/test.py
0 → 100644
View file @
21ee9cbc
from
invoke
import
task
from
tasks.helpers
import
title
@
task
def
lint
(
c
):
"""Run Linter."""
title
(
lint
.
__doc__
)
c
.
run
(
"flake8 splito tasks"
,
pty
=
True
)
@
task
def
types
(
c
):
"""Run type checker."""
title
(
types
.
__doc__
)
c
.
run
(
"mypy --strict splito"
,
pty
=
True
)
@
task
(
lint
,
types
)
def
static
(
c
):
pass
@
task
def
unit
(
c
):
"""Run unit tests."""
title
(
unit
.
__doc__
)
c
.
run
(
"mamba --format documentation splito/domain"
,
pty
=
True
)
c
.
run
(
"mamba --format documentation splito/use_cases"
,
pty
=
True
)
@
task
def
integration
(
c
):
"""Run integration tests."""
title
(
integration
.
__doc__
)
pass
@
task
def
functional
(
c
):
"""Run functional tests."""
title
(
functional
.
__doc__
)
@
task
(
static
,
unit
)
def
fast
(
c
):
pass
@
task
(
integration
,
functional
)
def
slow
(
c
):
pass
@
task
(
fast
,
slow
,
name
=
"all"
,
default
=
True
)
def
all
(
c
):
pass
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment