Skip to content

Commit dad276e

Browse files
authored
Merge pull request #1072 from Licini/workflow
use black
2 parents 3f9deb8 + b3afdd7 commit dad276e

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
* Added Rhino `Brep` plugin in `compas_rhino.geometry.brep`.
1818
* Added boolean operations to the `compas_rhino` `Brep` backend.
1919
* Added boolean operation operator overloads in `compas.geometry.Brep`
20+
* Added `format` task using `black` formatter.
2021

2122
### Changed
2223
* Based all gltf data classes on `BaseGLTFDataClass`
2324

2425
* Fixed `Color.__get___` AttributeError.
2526
* Fixed `cylinder_to_rhino` conversion to match `compas.geometry.Cylinder` location.
27+
* Changed linter to `black`.
28+
* Automatically trigger `invoke format` during `invoke release`.
2629

2730
### Removed
2831

tasks.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,15 @@ def docs(ctx, doctest=False, rebuild=False, check_links=False):
129129
@task()
130130
def lint(ctx):
131131
"""Check the consistency of coding style."""
132-
log.write("Running flake8 python linter...")
133-
ctx.run("flake8 src")
132+
log.write("Running black python linter...")
133+
ctx.run("black --check --diff --color src tests")
134+
135+
136+
@task()
137+
def format(ctx):
138+
"""Reformat the code base using black."""
139+
log.write("Running black python formatter...")
140+
ctx.run("black src tests")
134141

135142

136143
@task()
@@ -254,6 +261,9 @@ def release(ctx, release_type):
254261
"The release type parameter is invalid.\nMust be one of: major, minor, patch"
255262
)
256263

264+
# Run formmatter
265+
ctx.run("invoke format")
266+
257267
# Run checks
258268
ctx.run("invoke check test")
259269

0 commit comments

Comments
 (0)