diff --git a/DEVELOPMENT_GUIDE.md b/DEVELOPMENT_GUIDE.md index 1d11af4cb..131250c5a 100644 --- a/DEVELOPMENT_GUIDE.md +++ b/DEVELOPMENT_GUIDE.md @@ -59,7 +59,7 @@ eval "$(pyenv virtualenv-init -)" We format our code using [Black](https://github.com/python/black) and verify the source code is black compliant during PR checks. Black will be installed automatically with `make init`. -After installing, you can run our formatting through our Makefile by `make black` or integrating Black directly in your favorite IDE (instructions +After installing, you can run our formatting through our Makefile by `make format` or integrating Black directly in your favorite IDE (instructions can be found [here](https://black.readthedocs.io/en/stable/editor_integration.html)) ##### (Workaround) Integrating Black directly in your favorite IDE diff --git a/Makefile b/Makefile index 1cfe80916..559976d8a 100755 --- a/Makefile +++ b/Makefile @@ -17,14 +17,20 @@ test-cov-report: integ-test: pytest --no-cov integration/ -black: +format: black setup.py samtranslator tests integration bin schema_source bin/transform-test-error-json-format.py --write tests/translator/output/error_*.json bin/json-format.py --write tests integration samtranslator/policy_templates_data bin/yaml-format.py --write tests bin/yaml-format.py --write integration --add-test-metadata -black-check: +black: + $(warning `make black` is deprecated, please use `make format`) + # sleep for 5 seconds so the message can be seen. + sleep 5 + make format + +format-check: # Checking latest schema was generated (run `make schema` if this fails) mkdir -p .tmp python -m samtranslator.internal.schema_source.schema --sam-schema .tmp/sam.schema.json --cfn-schema schema_source/cloudformation.schema.json --unified-schema .tmp/schema.json @@ -36,6 +42,12 @@ black-check: bin/yaml-format.py --check tests bin/yaml-format.py --check integration --add-test-metadata +black-check: + $(warning `make black-check` is deprecated, please use `make format-check`) + # sleep for 5 seconds so the message can be seen. + sleep 5 + make format-check + lint: ruff samtranslator bin schema_source integration tests # mypy performs type check @@ -78,7 +90,7 @@ schema-all: fetch-schema-data update-schema-data schema dev: test # Verifications to run before sending a pull request -pr: black-check lint init dev +pr: format-check lint init dev clean: rm -rf .tmp