Skip to content

Commit 47f74e4

Browse files
resolved conversation
1 parent 3c76f42 commit 47f74e4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

exasol/toolbox/nox/_documentation.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ def _build_multiversion_docs(session: nox.Session, config: Config) -> None:
3939
)
4040

4141

42-
def _git_diff_changes_main() -> bool:
43-
"""return True if doc/changes is unchanged"""
42+
def _git_diff_changes_main() -> int:
43+
"""
44+
Check if doc/changes is changed and return the exit code of command git diff.
45+
The exit code is 0 if there are no changes.
46+
"""
4447
p = subprocess.run(
4548
[
4649
"git",
@@ -52,7 +55,7 @@ def _git_diff_changes_main() -> bool:
5255
],
5356
capture_output=True,
5457
)
55-
return p.returncode != 0
58+
return p.returncode
5659

5760

5861
@nox.session(name="docs:multiversion", python=False)
@@ -88,7 +91,7 @@ def clean_docs(_session: Session) -> None:
8891
@nox.session(name="changelog:updated", python=False)
8992
def updated(_session: Session) -> None:
9093
"""Checks if the change log has been updated"""
91-
if not _git_diff_changes_main():
94+
if _git_diff_changes_main() == 0:
9295
print(
9396
"Changelog is not updated.\n"
9497
"Please describe your changes in the changelog!"

0 commit comments

Comments
 (0)