From 1617c282813d160937b304eb5d40af94f1891d52 Mon Sep 17 00:00:00 2001 From: Hedy Li Date: Fri, 21 Aug 2020 09:20:36 +0000 Subject: [PATCH] rename make, update workflow and contributing --- .github/workflows/pythonpackage.yml | 2 +- CONTRIBUTING.md | 6 +++++- Makefile | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 824b748c8..122773312 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -23,7 +23,7 @@ jobs: poetry install - name: Format check with black run: | - make format + make format-check - name: Typecheck with mypy run: | make typecheck diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 374b4e85b..b9650ceee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,4 +45,8 @@ Please add type annotations for all new code. ### Code Formatting -Rich uses `black` for code formatting. I recommend setting up black in your editor to format on save. +Rich uses [`black`](https://github.com/psf/black) for code formatting. +I recommend setting up black in your editor to format on save. + +To run black from the command line, use `make format-check` to check your formatting, +and use `make format` to format and write to the files. \ No newline at end of file diff --git a/Makefile b/Makefile index a4c62de29..6bed4f767 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ test: pytest --cov-report term-missing --cov=rich tests/ -vv +format-check: + black --check . format: - black --check rich tests + black . typecheck: mypy -p rich --ignore-missing-imports --warn-unreachable typecheck-report: