Skip to content

Commit 9497900

Browse files
authored
Merge pull request #96 from Miyamura80/feature/lint-links
🔨 Add markdown link linter
2 parents 237334b + f8289ac commit 9497900

7 files changed

Lines changed: 1264 additions & 1328 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Markdown Link Validation
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 1' # Every Monday at midnight
6+
workflow_dispatch:
7+
8+
jobs:
9+
validate-links:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v5
18+
with:
19+
enable-cache: true
20+
21+
- name: Set up Python
22+
run: uv python install
23+
24+
- name: Install dependencies
25+
run: uv sync --dev
26+
27+
- name: Validate links
28+
run: make lint_links

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ repos:
55
- id: check-added-large-files
66
- repo: local
77
hooks:
8+
- id: lint-links
9+
name: Lint markdown links
10+
entry: make lint_links
11+
language: system
12+
pass_filenames: false
13+
always_run: true
814
- id: make-fmt
915
name: Run formatter (make fmt)
1016
entry: make fmt

CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ make fmt # Run ruff formatter + JSON formatting
2525
make ruff # Run ruff linter
2626
make vulture # Find dead code
2727
make ty # Run type checker
28-
make ci # Run all CI checks (ruff, vulture, ty, import_lint, docs_lint, check_deps)
28+
make lint_links # Check for broken links in markdown files (README, etc.)
29+
make ci # Run all CI checks (ruff, vulture, ty, import_lint, docs_lint, check_deps, lint_links)
2930

3031
# Dependencies
3132
uv sync # Install dependencies (not pip install)

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ docs_lint: ## Lint docs links
249249
@cd docs && bun run lint:links
250250
@echo "$(GREEN)✅Docs linting completed.$(RESET)"
251251

252+
lint_links: ## Lint all markdown links using pytest-check-links
253+
@echo "$(YELLOW)🔍Linting all markdown links with pytest-check-links...$(RESET)"
254+
@find . -name "*.md" -not -path "./.venv/*" -not -path "./node_modules/*" -not -path "./docs/node_modules/*" | xargs uv run pytest -p no:cov -o "addopts=" --check-links --check-links-ignore "http://localhost:.*"
255+
@echo "$(GREEN)✅Link linting completed.$(RESET)"
256+
252257
agents_validate: ## Validate AGENTS.md content
253258
@echo "$(YELLOW)🔍Validating AGENTS.md...$(RESET)"
254259
@$(PYTHON) scripts/validate_agents_md.py
@@ -259,7 +264,7 @@ check_deps: install_tools ## Check for unused dependencies
259264
@uv run deptry .
260265
@echo "$(GREEN)✅Dependency check completed.$(RESET)"
261266

262-
ci: ruff vulture import_lint ty docs_lint check_deps ## Run all CI checks (ruff, vulture, import_lint, ty, docs_lint)
267+
ci: ruff vulture import_lint ty docs_lint lint_links check_deps ## Run all CI checks (ruff, vulture, import_lint, ty, docs_lint, lint_links)
263268
@echo "$(GREEN)✅CI checks completed.$(RESET)"
264269

265270
########################################################

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Opinionated Python stack for fast development. The `saas` branch extends `main`
5151
| Referrals + Agent system |||
5252
| Ralph Wiggum Agent Loop |||
5353

54-
[Full comparison](docs/branch_comparison.md)
54+
[Full comparison](manual_docs/branch_comparison.md)
5555

5656
## Quick Start
5757

@@ -75,12 +75,12 @@ global_config.example_parent.example_child
7575
global_config.OPENAI_API_KEY
7676
```
7777

78-
[Full configuration docs](docs/configuration.md)
78+
[Full configuration docs](manual_docs/configuration.md)
7979

8080
## Credits
8181

8282
This software uses the following tools:
83-
- [Cursor: The AI Code Editor](cursor.com)
83+
- [Cursor: The AI Code Editor](https://cursor.com)
8484
- [uv](https://docs.astral.sh/uv/)
8585
- [prek: Rust-based pre-commit framework](https://github.com/j178/prek)
8686
- [DSPY: Pytorch for LLM Inference](https://dspy.ai/)

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,8 @@ omit = [
103103

104104
[tool.coverage.report]
105105
show_missing = true
106+
107+
[dependency-groups]
108+
dev = [
109+
"pytest-check-links>=0.9.1",
110+
]

0 commit comments

Comments
 (0)