You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
492 B
14 lines
492 B
import pathlib
|
|
|
|
|
|
def test_precommit_exists():
|
|
path = pathlib.Path(".pre-commit-config.yaml")
|
|
assert path.exists(), ".pre-commit-config.yaml must exist"
|
|
|
|
content = path.read_text(encoding="utf8")
|
|
assert "repos:" in content, "pre-commit config must contain 'repos:'"
|
|
|
|
# ensure at least one formatter/linter is referenced
|
|
assert any(x in content for x in ("black", "ruff", "isort")), (
|
|
"pre-commit config must reference at least one of: black, ruff, isort"
|
|
)
|
|
|