mirror of
https://github.com/evennia/evennia.git
synced 2025-10-29 11:26:10 +00:00
Add auto-formatting via black
Introduce black, a Python code formatter. Also a Makefile that includes two common targets: * fmt (auto-format the code) * lint (lint the code and return non-zero if out of spec) We can re-use the latter in CI. By introducing a code formatter, we can cut down on stylistic variations across a now-large codebase. We can also avoid most style discussions in PR if we just have this thing enforce it for us.
This commit is contained in:
parent
bce118ca93
commit
ac810054aa
12
Makefile
Normal file
12
Makefile
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
default: install
|
||||||
|
|
||||||
|
BLACK_FORMAT_CONFIGS = --target-version py37 --line-length 100
|
||||||
|
|
||||||
|
install:
|
||||||
|
python setup.py develop
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
black $(BLACK_FORMAT_CONFIGS) evennia
|
||||||
|
|
||||||
|
lint:
|
||||||
|
black --check $(BLACK_FORMAT_CONFIGS) evennia
|
||||||
@ -9,9 +9,10 @@ inflect
|
|||||||
autobahn >= 17.9.3
|
autobahn >= 17.9.3
|
||||||
model_mommy
|
model_mommy
|
||||||
|
|
||||||
# testing
|
# testing and development
|
||||||
mock >= 1.0.1
|
mock >= 1.0.1
|
||||||
anything
|
anything
|
||||||
|
black
|
||||||
|
|
||||||
# windows-specific
|
# windows-specific
|
||||||
pypiwin32;platform_system=="Windows"
|
pypiwin32;platform_system=="Windows"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user