Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 743d2d8

Browse files
authored
Separate linting from formatting in CI, always run all steps of workflow (#4202)
1 parent 4e47894 commit 743d2d8

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

.github/workflows/master.yml

+12
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,23 @@ jobs:
6262
run: |
6363
pip freeze
6464
65+
- name: Format
66+
if: always()
67+
run: |
68+
make format
69+
6570
- name: Lint
71+
if: always()
6672
run: |
6773
make lint
6874
6975
- name: Type check
76+
if: always()
7077
run: |
7178
make typecheck
7279
7380
- name: Run tests
81+
if: always()
7482
run: |
7583
make test-with-cov
7684
@@ -234,6 +242,10 @@ jobs:
234242
run: |
235243
pip install $(ls dist/*.whl)
236244
245+
- name: Pip freeze
246+
run: |
247+
pip freeze
248+
237249
- name: Test install
238250
run: |
239251
allennlp test-install

.github/workflows/pull_request.yml

+9
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,28 @@ jobs:
4949
run: |
5050
pip freeze
5151
52+
- name: Format
53+
if: always()
54+
run: |
55+
make format
56+
5257
- name: Lint
58+
if: always()
5359
run: |
5460
make lint
5561
5662
- name: Type check
63+
if: always()
5764
run: |
5865
make typecheck
5966
6067
- name: Run tests
68+
if: always()
6169
run: |
6270
make test-with-cov
6371
6472
- name: Ensure docs can build
73+
if: always()
6574
run: |
6675
make build-docs
6776

CONTRIBUTING.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Once you open a pull request, our [continuous build system](https://github.com/a
2323
You can run all of these checks locally using the following `make` commands:
2424

2525
* `make test`: Runs [`pytest`](https://docs.pytest.org/en/latest/) on all unit tests.
26-
* `make lint`: Runs [`flake8`](http://flake8.pycqa.org/) to check code style and [`black`](https://black.readthedocs.io) to check code formatting.
26+
* `make format`: Runs [`black`](https://black.readthedocs.io) to check code formatting.
27+
* `make lint`: Runs [`flake8`](http://flake8.pycqa.org/) to lint the code.
2728
* `make typecheck`: Runs [`mypy`](http://mypy-lang.org/) to typecheck the code.
2829
* `make build-docs`: Ensures the docs can be generated successfully.
2930

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ version :
3636
.PHONY : lint
3737
lint :
3838
flake8 ./scripts $(SRC)
39+
40+
.PHONY : format
41+
format :
3942
black --check ./scripts $(SRC)
4043

4144
.PHONY : typecheck

0 commit comments

Comments
 (0)