Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Rename make black* to make format* #2970

Merged
merged 3 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEVELOPMENT_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
hoffa marked this conversation as resolved.
Show resolved Hide resolved
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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down