Skip to content

Commit ddf7a32

Browse files
committed
Add Python code formatting with Black as Make steps
This patch adds two Make targets to the test environment so a manual format-review can be done: * Testing - `cd tests ; make check-black` * Formatting - `cd tests ; make format` Further discussion needs to be had before these are added to CI steps. A follow-on patch will apply Black, so mechanical effects can be separated from manual changes. References: * [AC-215] Evaluate pre-commit usage on casework repositories * [AC-216] Apply Black to all casework Python code bases Acked-by: kchason <kchason@users.noreply.github.com> Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
1 parent 39157fb commit ddf7a32

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ check: \
6767
--ignore case_utils \
6868
--log-level=DEBUG
6969

70+
# TODO - Need to settle on policy for incorporating this and 'format' recipe into CI.
71+
# https://case.atlassian.net/browse/AC-215
72+
# https://case.atlassian.net/browse/AC-216
73+
check-black: \
74+
.venv.done.log
75+
source venv/bin/activate \
76+
&& black \
77+
--check \
78+
$(top_srcdir)/case_utils \
79+
$$PWD
80+
7081
check-case_utils: \
7182
.venv.done.log
7283
$(MAKE) \
@@ -101,3 +112,13 @@ clean:
101112

102113
download: \
103114
.venv.done.log
115+
116+
# TODO - Need to settle on policy for incorporating this and 'check-black' recipe into CI.
117+
# https://case.atlassian.net/browse/AC-215
118+
# https://case.atlassian.net/browse/AC-216
119+
format: \
120+
.venv.done.log
121+
source venv/bin/activate \
122+
&& black \
123+
$(top_srcdir)/case_utils \
124+
$$PWD

tests/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
PyLD
2+
black
23
mypy
34
pytest
45
python-dateutil

0 commit comments

Comments
 (0)