Skip to content

Commit 6ab7918

Browse files
Merge pull request #131 from discord-modmail/ci/run-flake8-black-on-pre-commit-failure
ci/run flake8 black on pre commit failure
2 parents eec59a3 + 763a243 commit 6ab7918

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/lint_test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,14 @@ jobs:
9292
# black and flake8 action. As pre-commit does not support user installs,
9393
# we set PIP_USER=0 to not do a user install.
9494
- name: Run pre-commit hooks
95+
id: pre-commit
9596
run: export PIP_USER=0; SKIP="no-commit-to-branch,black,flake8" pre-commit run --all-files
9697

9798
# Run black seperately as we don't want to reformat the files
9899
# just error if something isn't formatted correctly.
99100
- name: Check files with black
101+
id: black
102+
if: always() && (steps.pre-commit.outcome == 'success' || steps.pre-commit.outcome == 'failure')
100103
run: black . --check --diff --color
101104

102105
# Run flake8 and have it format the linting errors in the format of
@@ -108,6 +111,8 @@ jobs:
108111
# Format used:
109112
# ::error file={filename},line={line},col={col}::{message}
110113
- name: Run flake8
114+
id: flake8
115+
if: always() && (steps.pre-commit.outcome == 'success' || steps.pre-commit.outcome == 'failure')
111116
run: "flake8 \
112117
--format='::error file=%(path)s,line=%(row)d,col=%(col)d::\
113118
[flake8] %(code)s: %(text)s'"

0 commit comments

Comments
 (0)