Skip to content

Commit c181b93

Browse files
committed
build: use cog --check-fail-msg to instruct devs
1 parent 33c4ba1 commit c181b93

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

doc/cog_helpers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ def show_configs(ini, toml):
8282
toml, toml_vals = _read_config(toml, "covrc.toml")
8383
for key, val in ini_vals.items():
8484
if val != toml_vals[key]:
85-
cog.error(f"Mismatch! {key}:\nini: {val!r}\ntoml: {toml_vals[key]!r}")
85+
cog.error(
86+
f"Mismatch between configuration tabs in docs for {key = }:\n"
87+
+ f" ini: {val!r}\n"
88+
+ f" toml: {toml_vals[key]!r}"
89+
)
8690

8791
ini2 = re.sub(r"(?m)^\[", "[coverage:", ini)
8892
print()

tox.ini

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ deps =
8181
allowlist_externals =
8282
make
8383
commands =
84-
# If this command fails, see the comment at the top of doc/cmd.rst
85-
python -m cogapp -cP --check --verbosity=1 doc/*.rst
84+
# If cog fails, it means the docs need to be updated. Run `make prebuild`.
85+
python -m cogapp -cP --check --check-fail-msg='run `make prebuild`' --verbosity=1 doc/*.rst doc/*/*.rst
8686
doc8 -q --ignore-path 'doc/_*' doc CHANGES.rst README.rst
8787
sphinx-lint doc CHANGES.rst README.rst
8888
sphinx-build -b html -aEnqW doc doc/_build/html
@@ -102,9 +102,10 @@ setenv =
102102

103103
commands =
104104
python -m tabnanny {env:LINTABLE}
105-
# If this command fails, see the comment at the top of doc/cmd.rst
106-
python -m cogapp -cP --check --verbosity=1 doc/*.rst
107-
python -m cogapp -cP --check --verbosity=1 .github/workflows/*.yml
105+
# If cog fails, it means the docs need to be updated. Run `make prebuild`.
106+
python -m cogapp -cP --check --check-fail-msg='run `make prebuild`' --verbosity=1 doc/*.rst doc/*/*.rst
107+
# If cog fails, it means the workflow files need to be updated. Run `make workflows`.
108+
python -m cogapp -cP --check --check-fail-msg='run `make workflows`' --verbosity=1 .github/workflows/*.yml
108109
ruff format --check
109110
python -m pylint -j 0 --notes= --ignore-paths 'doc/_build/.*' {env:LINTABLE}
110111
check-manifest --ignore 'doc/sample_html/*'

0 commit comments

Comments
 (0)