Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
c1c0e142
Commit
c1c0e142
authored
3 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[python][ci] Run black linter in the CI (only passes if no black would not change anything)
parent
ab4a0a4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2681
Feature/python main file
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci/default.yml
+9
-0
9 additions, 0 deletions
.gitlab-ci/default.yml
python/README.md
+11
-0
11 additions, 0 deletions
python/README.md
with
20 additions
and
0 deletions
.gitlab-ci/default.yml
+
9
−
0
View file @
c1c0e142
...
@@ -3,6 +3,7 @@ default:
...
@@ -3,6 +3,7 @@ default:
stages
:
stages
:
-
linting
-
configure
-
configure
-
select
-
select
-
build
-
build
...
@@ -30,6 +31,14 @@ configure:
...
@@ -30,6 +31,14 @@ configure:
-
build-cmake
-
build-cmake
expire_in
:
3 hours
expire_in
:
3 hours
python linting
:
stage
:
linting
image
:
registry.gitlab.com/pipeline-components/black:latest
script
:
# only check the python folder for now (Python code related to bindings)
# TODO: maybe extend this to the utility scripts?
-
black --check --verbose -- python
select tests
:
select tests
:
stage
:
select
stage
:
select
...
...
This diff is collapsed.
Click to expand it.
python/README.md
+
11
−
0
View file @
c1c0e142
...
@@ -69,3 +69,14 @@ You can run all currently existing DuMu<sup>x</sup> Python tests with
...
@@ -69,3 +69,14 @@ You can run all currently existing DuMu<sup>x</sup> Python tests with
cd dumux/build-cmake
cd dumux/build-cmake
ctest -L python
ctest -L python
```
```
## Development
All Python files should be linted by the tool
[
`black`
](
https://pypi.org/project/black/
)
.
You can install
`black`
with
`pip install black`
and run it from the dumux top-directory
```
black ./python
```
You can also run it on a specific file (replace
`./python`
by file name)
This will automatically format the Python files. Run black before every commit changing Python files.
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