Answer stability round 1: 2 🔴, 3 🟡; anchor .gitattributes to the root settings.json, sort the new imports, isolate the checkout tests from the host's git, start a new install's Update at git fetch, fix the filter's docstring

This commit is contained in:
2026-10-21 21:59:53 +02:00
parent d18b064e43
commit b57704d237
8 changed files with 83 additions and 43 deletions
+9 -5
View File
@@ -1,12 +1,15 @@
import json
import pathlib
import sys
import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from settings_filter import cleaned
from git_repo import git
from repo_checks.test_python_floor import ROOT
from settings_filter import cleaned
INSTALL = "git config filter.settings.clean bin/settings_filter.py"
class Settings(unittest.TestCase):
@@ -14,8 +17,9 @@ class Settings(unittest.TestCase):
# The index, not the working file: the working file holds this machine's model in Claude Code's key order.
stored = git("show", ":settings.json", cwd=str(ROOT))
self.assertIsInstance(stored, str, stored)
self.assertEqual(stored, cleaned(stored))
self.assertNotIn("model", json.loads(stored))
self.assertEqual(stored, cleaned(stored), f"commit settings.json with the filter on: {INSTALL}")
def test_the_readme_installs_the_filter_git_attributes_name(self):
self.assertIn("settings.json filter=settings\n", (ROOT / ".gitattributes").read_text(encoding="utf-8"))
self.assertIn("git config filter.settings.clean bin/settings_filter.py\n", (ROOT / "README.md").read_text(encoding="utf-8"))
def test_the_readme_installs_the_filter_git_attributes_names_for_the_root_settings_only(self):
self.assertEqual("/settings.json filter=settings\n", (ROOT / ".gitattributes").read_text(encoding="utf-8"))
self.assertIn(f"{INSTALL}\n", (ROOT / "README.md").read_text(encoding="utf-8"))