test(repo): the term check covers shared/ too; changelog notes the commons sync
shared/ now carries portfolio-optimiser-commons 8aa19ec (squash merge in the parent commits), and no file under it matches the local term list any more (22 of 67 files before, 0 of 50 after). The shared/ exception and the test that kept it alive are removed, so the repository-wide check reads every tracked file. The surface-count pin follows the manifest: 1427 -> 1410. CHANGELOG 1.3.0 gains one line for the sync; the version stays 1.3.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d2268f7022
commit
97469447e5
3 changed files with 7 additions and 30 deletions
|
|
@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Replace sector-specific example material with generic, fictitious examples. The context sets
|
- Replace sector-specific example material with generic, fictitious examples. The context sets
|
||||||
under `contexts/`, the packaged knowledge bases and the example bundles are all fictitious now;
|
under `contexts/`, the packaged knowledge bases and the example bundles are all fictitious now;
|
||||||
gate figures measured on them are not comparable with those of earlier releases.
|
gate figures measured on them are not comparable with those of earlier releases.
|
||||||
|
- Sync `shared/` from portfolio-optimiser-commons 0.2.0, which removes two example bundles there
|
||||||
|
and makes its remaining examples fictitious as well. The repository-wide term check now covers
|
||||||
|
`shared/` too.
|
||||||
|
|
||||||
## [1.2.0] - 2026-09-20
|
## [1.2.0] - 2026-09-20
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -601,7 +601,7 @@ _WRITERS_DEFINED = 10
|
||||||
_WRITERS_IN_RUN_PATH = 7
|
_WRITERS_IN_RUN_PATH = 7
|
||||||
#: publiserte filer i git-manifestet (uttrekk og arbeidstre gir SAMME tall — det var hele poenget
|
#: publiserte filer i git-manifestet (uttrekk og arbeidstre gir SAMME tall — det var hele poenget
|
||||||
#: med å slutte å telle filtreet: 435 i arbeidstreet var to gitignorerte .local.md-filer).
|
#: med å slutte å telle filtreet: 435 i arbeidstreet var to gitignorerte .local.md-filer).
|
||||||
_PUBLISHED_TODAY = 1427
|
_PUBLISHED_TODAY = 1410
|
||||||
_UNDECODABLE_TODAY = 1
|
_UNDECODABLE_TODAY = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,8 @@ place. ``test_the_term_list_is_never_tracked`` holds the other half: the list st
|
||||||
The same file carries each pattern's known-positive and a set of known-negatives, so a pattern
|
The same file carries each pattern's known-positive and a set of known-negatives, so a pattern
|
||||||
that cannot fire, or one that fires on ordinary prose, is red rather than silently useless.
|
that cannot fire, or one that fires on ordinary prose, is red rather than silently useless.
|
||||||
|
|
||||||
**One named, tested exception:** ``shared/``, the ``git subtree`` of
|
``shared/``, the ``git subtree`` of ``portfolio-optimiser-commons``, is scanned like every other
|
||||||
``portfolio-optimiser-commons``. Its sync is pull-only: content changes there are committed in
|
prefix: its content is cleaned in commons and pulled here, so a hit there is fixed in commons.
|
||||||
commons and pulled here, never edited here. The exception is itself gated — once no file under
|
|
||||||
the prefix hits, the exception is dead and a test says to remove it.
|
|
||||||
|
|
||||||
Every scan carries its denominator: a gate that read zero files would be green and prove nothing.
|
Every scan carries its denominator: a gate that read zero files would be green and prove nothing.
|
||||||
"""
|
"""
|
||||||
|
|
@ -32,9 +30,6 @@ import pytest
|
||||||
_REPO_ROOT = Path(__file__).resolve().parents[1]
|
_REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||||
TERMS_FILE = _REPO_ROOT / "tests" / "excluded-terms.local.md"
|
TERMS_FILE = _REPO_ROOT / "tests" / "excluded-terms.local.md"
|
||||||
|
|
||||||
#: The subtree prefix whose content is owned by another repository (see the module docstring).
|
|
||||||
SUBTREE_PREFIX = "shared/"
|
|
||||||
|
|
||||||
|
|
||||||
def load_terms(
|
def load_terms(
|
||||||
path: Path = TERMS_FILE,
|
path: Path = TERMS_FILE,
|
||||||
|
|
@ -106,11 +101,7 @@ def test_no_tracked_file_carries_an_excluded_term(terms) -> None:
|
||||||
patterns = terms[0]
|
patterns = terms[0]
|
||||||
names = tracked_files()
|
names = tracked_files()
|
||||||
assert len(names) > 100, f"git ls-files listed {len(names)} files -- too few to be this repo"
|
assert len(names) > 100, f"git ls-files listed {len(names)} files -- too few to be this repo"
|
||||||
offending = {
|
offending = scan(names, patterns)
|
||||||
name: hits
|
|
||||||
for name, hits in scan(names, patterns).items()
|
|
||||||
if not name.startswith(SUBTREE_PREFIX)
|
|
||||||
}
|
|
||||||
report = "\n".join(
|
report = "\n".join(
|
||||||
f"{name}:{number}: [{label}] {line}"
|
f"{name}:{number}: [{label}] {line}"
|
||||||
for name, hits in sorted(offending.items())
|
for name, hits in sorted(offending.items())
|
||||||
|
|
@ -142,20 +133,3 @@ def test_the_term_list_is_never_tracked() -> None:
|
||||||
assert rel not in tracked_files(), f"{rel} is tracked -- it must stay local-only"
|
assert rel not in tracked_files(), f"{rel} is tracked -- it must stay local-only"
|
||||||
ignored = subprocess.run(["git", "check-ignore", "-q", rel], cwd=_REPO_ROOT)
|
ignored = subprocess.run(["git", "check-ignore", "-q", rel], cwd=_REPO_ROOT)
|
||||||
assert ignored.returncode == 0, f"{rel} is not covered by .gitignore"
|
assert ignored.returncode == 0, f"{rel} is not covered by .gitignore"
|
||||||
|
|
||||||
|
|
||||||
def test_the_subtree_exception_is_still_needed_and_is_the_subtree(terms) -> None:
|
|
||||||
"""The ``shared/`` exception is alive only while the subtree still carries excluded terms.
|
|
||||||
|
|
||||||
Both halves are the claim: the prefix is the subtree (its README says so), and at least one
|
|
||||||
file under it still hits. When the cleanup has been pulled from commons, the second half goes
|
|
||||||
red and the exception must be deleted here rather than linger as a hole nobody remembers.
|
|
||||||
"""
|
|
||||||
readme = (_REPO_ROOT / SUBTREE_PREFIX / "README.md").read_text(encoding="utf-8")
|
|
||||||
assert "git subtree" in readme and "shared/" in readme
|
|
||||||
under = [name for name in tracked_files() if name.startswith(SUBTREE_PREFIX)]
|
|
||||||
assert under, "no tracked file under the subtree prefix -- the exception names nothing"
|
|
||||||
assert scan(under, terms[0]), (
|
|
||||||
"no file under shared/ carries an excluded term any more: remove SUBTREE_PREFIX from "
|
|
||||||
"this file"
|
|
||||||
)
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue