Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@ permissions:
contents: read

jobs:
lint:
name: Lint & Style Check (Ruff)
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Ruff
run: |
python -m pip install --upgrade pip
pip install "ruff>=0.4.0"

- name: Run Ruff Lint
run: ruff check .

test:
name: Test (${{ matrix.os }}, py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

- **CI Matrix Hardening (Path A)**: Added a dedicated, fast-failing `lint` job running `ruff check .` on Python 3.12 (`ubuntu-latest`) in `.github/workflows/tests.yml` to enforce static code hygiene in CI.
- **Contract Testing Expansion**: Extended `tests/test_repository_hygiene.py` with `test_llms_txt_contract` (validating canonical repository, ethical boundaries, license, and verification anchors in `llms.txt`) and `test_ruff_linter_contract` (validating tool configuration and clean codebase linting), bringing test suite coverage to 108 passed tests.
- **Documentation & Verification**: Synchronized test pass badges (`108 passed, 1 skipped`) across `README.md`, `README_de.md`, and `llms.txt` with `Last-checked: 2026-11-03`.

## 2026-09-10

- **CI Matrix Hardening (Path A)**: Upgraded `.github/workflows/tests.yml` to official `@v4`/`@v5` GitHub Actions, added cross-platform testing on Ubuntu and Windows across Python 3.10–3.13, configured job concurrency with `cancel-in-progress: true`, and added bytecode validation (`compileall`) and CLI smoke verification steps.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

[![CI](https://github.com/dev-bricks/ApiProber/actions/workflows/tests.yml/badge.svg)](https://github.com/dev-bricks/ApiProber/actions/workflows/tests.yml)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/)
[![Pytest 106 passed, 1 skipped](https://img.shields.io/badge/pytest-106_passed%2C_1_skipped-brightgreen.svg)](https://docs.pytest.org/)
[![Pytest 108 passed, 1 skipped](https://img.shields.io/badge/pytest-108_passed%2C_1_skipped-brightgreen.svg)](https://docs.pytest.org/)
[![Zero Dependencies](https://img.shields.io/badge/dependencies-zero-success.svg)]()
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![LLM-Ready](https://img.shields.io/badge/LLM--Ready-llms.txt-success.svg)](llms.txt)
Expand Down
2 changes: 1 addition & 1 deletion README_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

[![CI](https://github.com/dev-bricks/ApiProber/actions/workflows/tests.yml/badge.svg)](https://github.com/dev-bricks/ApiProber/actions/workflows/tests.yml)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/)
[![Pytest 106 bestanden, 1 übersprungen](https://img.shields.io/badge/pytest-106_bestanden%2C_1_%C3%BCbersprungen-brightgreen.svg)](https://docs.pytest.org/)
[![Pytest 108 bestanden, 1 übersprungen](https://img.shields.io/badge/pytest-108_bestanden%2C_1_%C3%BCbersprungen-brightgreen.svg)](https://docs.pytest.org/)
[![Zero Dependencies](https://img.shields.io/badge/Abh%C3%A4ngigkeiten-keine-success.svg)]()
[![Lizenz: MIT](https://img.shields.io/badge/Lizenz-MIT-yellow.svg)](LICENSE)
[![LLM-Ready](https://img.shields.io/badge/LLM--Ready-llms.txt-success.svg)](llms.txt)
Expand Down
4 changes: 2 additions & 2 deletions llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ ApiProber is not Cloudprober, probe-rs, an uptime monitor, a hardware debug
probe, or a semantic code-search engine. It is a local Python CLI for documenting
authorized REST API surfaces with read-only probing and SQLite persistence.

Verified locally on 2026-09-10: 100 passed, 1 skipped.
Verified locally on 2026-11-03: 108 passed, 1 skipped.

## Last-checked: 2026-09-10
## Last-checked: 2026-11-03
34 changes: 34 additions & 0 deletions tests/test_repository_hygiene.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import json
from pathlib import Path
import re
import subprocess
import sys

REPO_ROOT = Path(__file__).resolve().parent.parent

Expand Down Expand Up @@ -63,6 +65,7 @@ def test_ci_matrix_coverage():
assert "actions/setup-python@v5" in content
assert "python -m compileall -q ." in content
assert "pytest -ra -v" in content
assert "ruff check ." in content


def test_gitignore_protection():
Expand Down Expand Up @@ -205,3 +208,34 @@ def test_pep621_license_files_and_keywords():
raw_keywords = [k.strip(' \n\t"') for k in match.group(1).split(",") if k.strip(' \n\t"')]
assert len(raw_keywords) >= 15, f"Expected >= 15 keywords, found {len(raw_keywords)}"


def test_llms_txt_contract():
"""Verify llms.txt exists and specifies boundaries, repository, and verification commands."""
llms_path = REPO_ROOT / "llms.txt"
assert llms_path.exists(), "llms.txt must exist"

content = llms_path.read_text(encoding="utf-8")
assert "Canonical repository: https://github.com/dev-bricks/ApiProber" in content
assert "Owner organization: dev-bricks" in content
assert "License: MIT" in content
assert "standard library only" in content
assert "test_smoke.py" in content
assert "python -m compileall -q ." in content
assert "Last-checked: 2026-11-03" in content
assert "Verified locally on 2026-11-03:" in content


def test_ruff_linter_contract():
"""Verify ruff linter configuration in pyproject.toml and clean static analysis."""
pyproject_text = (REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8")
assert "[tool.ruff]" in pyproject_text
assert "[tool.ruff.lint]" in pyproject_text
assert "line-length = 100" in pyproject_text

result = subprocess.run(
[sys.executable, "-m", "ruff", "check", str(REPO_ROOT)],
capture_output=True,
text=True,
encoding="utf-8",
)
assert result.returncode == 0, f"Ruff linting failed: {result.stdout}\n{result.stderr}"
Loading