Skip to content

Commit 4dacd0b

Browse files
committed
chore
1 parent 69fb580 commit 4dacd0b

11 files changed

Lines changed: 179 additions & 131 deletions

File tree

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# ============================================================
2+
# .editorconfig (Standardize files across editors and IDEs)
3+
# ============================================================
4+
15
# REQ.UNIVERSAL: All professional GitHub project repositories MUST include .editorconfig.
26
# WHY: Establish a cross-editor baseline so diffs stay clean and formatting is consistent.
37
# ALT: Repository may omit .editorconfig ONLY if formatting is enforced equivalently by CI and formatter tooling.

.github/dependabot.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1+
# ============================================================
2+
# .github/dependabot.yml (Check for GitHub Actions updates)
3+
# ============================================================
4+
# SOURCE: https://github.com/denisecase/templates
5+
#
16
# REQ.PROJECT: This repository SHOULD track GitHub Actions updates automatically.
2-
# WHY: GitHub Actions are executable dependencies and may receive security or behavior updates.
3-
# OBS: This repository has no language-level dependencies (Python, JS, Rust, etc.).
4-
# OBS: GitHub Actions are the only dependency class currently in scope.
7+
# WHY-FILE: GitHub Actions are executable dependencies and may receive security or behavior updates.
8+
# OBS: Language-level dependencies (e.g., Python packages) are upgraded manually.
9+
# OBS: GitHub Actions are the only dependency class automated here.
510
# ALT: Dependabot could be omitted if workflows are pinned and reviewed manually.
611
# CUSTOM: Update interval if CI cadence or security posture changes.
712

8-
version: 2
13+
# NOTE: This file automatically updates the versions used in Actions workflows.
14+
# You don't need to modify this file.
15+
# To disable: Delete this file or set enabled: false below.
16+
# enabled: false # Uncomment to disable Dependabot
917

10-
updates:
11-
- package-ecosystem: "github-actions"
12-
directory: "/"
18+
version: 2 # Dependabot configuration version
1319

14-
# WHY: Monthly cadence balances stability with security updates.
15-
# ALT: Use "weekly" for higher-security environments.
20+
updates:
21+
- package-ecosystem: "github-actions" # Dependency type
22+
directory: "/" # Location of GitHub Actions workflows
1623
schedule:
17-
interval: "monthly"
18-
19-
# WHY: Clear commit prefix simplifies changelog review and filtering.
24+
interval: "monthly" # ALT: Use "weekly" for higher security when needed
2025
commit-message:
21-
prefix: "(deps)"
26+
prefix: "(deps)" # WHY: enable filtering by commit type
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# ============================================================
2+
# .github/workflows/ci-hygiene-mkdocs.yml (Continuous Integration)
3+
# ============================================================
4+
# SOURCE: https://github.com/denisecase/templates
5+
#
6+
# WHY-FILE: Validate repository hygiene and documentation builds.
7+
# REQ: Any check that can be run locally MUST be available locally via pre-commit.
8+
# REQ: CI MUST NOT introduce arbitrary rules that are not reproducible locally.
9+
# OBS: CI validates only; it never edits files or deploys docs.
10+
11+
name: CI Hygiene (MkDocs Site)
12+
13+
# WHY: Validate docs and repo metadata on PRs and pushes.
14+
# OBS: This workflow validates only; it never deploys.
15+
16+
on:
17+
push:
18+
branches: [main] # WHY: Run when pushing to main branch.
19+
pull_request:
20+
branches: [main] # WHY: Run on pull requests targeting main branch.
21+
workflow_dispatch: # WHY: Allow manual triggering from Actions tab.
22+
23+
permissions: # WHY: Use least privileges required.
24+
contents: read
25+
26+
env:
27+
PYTHONUNBUFFERED: "1" # WHY: Real-time logging.
28+
PYTHONIOENCODING: "utf-8" # WHY: Ensure UTF-8 encoding for international characters.
29+
30+
jobs:
31+
ci:
32+
name: Repository checks (pre-commit)
33+
runs-on: ubuntu-latest # WHY: Linux environment matches most production deployments
34+
timeout-minutes: 30 # WHY: Prevent hanging jobs. If over, it is likely stuck.
35+
36+
37+
steps:
38+
# ============================================================
39+
# ASSEMBLE: Get code and set up environment
40+
# ============================================================
41+
42+
- name: A1) Checkout repository code
43+
# WHY: Needed to access files for checks.
44+
uses: actions/checkout@v6
45+
46+
- name: A2) Run pre-commit (all files)
47+
# WHY: Single source of truth for locally runnable quality gates.
48+
# OBS: Fails if hooks would modify files; does not commit changes.
49+
id: precommit # WHY: Identify step for conditional follow-up.
50+
uses: pre-commit/[email protected]
51+
with:
52+
extra_args: --all-files
53+
54+
- name: A2f) If pre-commit failed, run it locally
55+
if: failure()
56+
run: |
57+
echo "## Pre-commit failed" >> "$GITHUB_STEP_SUMMARY"
58+
echo "Please run pre-commit locally and commit the resulting changes." >> "$GITHUB_STEP_SUMMARY"
59+
60+
61+
- name: A3) Install uv (with caching)
62+
uses: astral-sh/setup-uv@v7
63+
with:
64+
enable-cache: true
65+
66+
- name: A4) Install Python version 3.12
67+
run: uv python install 3.12
68+
69+
- name: A5) Sync to install dependencies
70+
run: uv sync --extra dev --extra docs --upgrade
71+
72+
# === BASELINE CHECKS ===
73+
74+
- name: B1) Validate pyproject
75+
run: uvx validate-pyproject
76+
77+
# === DEPLOY (SANITY CHECKS ONLY; NO DEPLOY) ===
78+
79+
- name: D1) Build docs (mkdocs --strict)
80+
run: |
81+
if [ -f "mkdocs.yml" ] || [ -f "mkdocs.yaml" ]; then
82+
uv run mkdocs build --strict
83+
else
84+
echo "No mkdocs config found; skipping docs build."
85+
fi

.github/workflows/ci.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/workflows/deploy-docs.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,51 @@
1-
# .github/workflows/deploy-docs.yml
2-
name: Docs Deploy (MkDocs Python)
3-
1+
# ============================================================
2+
# .github/workflows/deploy-docs.yml (Deploy MkDocs)
3+
# ============================================================
4+
# SOURCE: https://github.com/denisecase/templates
45
# WHY: Build and deploy documentation to GitHub Pages on pushes to main.
56
# REQ: Repo Settings -> Pages -> Build and deployment -> Source:
67
# Deploy from a branch, Branch = gh-pages, Folder = /.
78

9+
name: Docs Deploy (MkDocs Python)
10+
11+
# WHY: Deploy project documentation on pushes to main branch.
12+
813
on:
914
push:
10-
branches: [main]
11-
workflow_dispatch:
15+
branches: [main] # WHY: Run when pushing to main branch.
16+
workflow_dispatch: # WHY: Allow manual triggering from Actions tab.
1217

1318
permissions:
1419
contents: write # WHY: Required to push to gh-pages
1520

1621
env:
17-
PYTHONUNBUFFERED: "1"
18-
PYTHONIOENCODING: "utf-8"
22+
PYTHONUNBUFFERED: "1" # WHY: Real-time logging.
23+
PYTHONIOENCODING: "utf-8" # WHY: Ensure UTF-8 encoding for international characters.
1924

2025
jobs:
2126
docs:
27+
name: Deploy MkDocs documentation site
2228
runs-on: ubuntu-latest
23-
timeout-minutes: 30
29+
timeout-minutes: 30 # WHY: Prevent hanging jobs. If over, it is likely stuck.
2430

2531
steps:
26-
# === ASSEMBLE ===
32+
# ============================================================
33+
# ASSEMBLE: Get code and set up environment
34+
# ============================================================
2735

28-
- name: A1) Checkout
36+
- name: A1) Checkout repository code
37+
# WHY: Needed to access files for checks.
2938
uses: actions/checkout@v6
3039

3140
- name: A2) Install uv (with caching)
3241
uses: astral-sh/setup-uv@v7
3342
with:
3443
enable-cache: true
3544

36-
- name: A3) Pin Python version for consistency
37-
run: uv python pin 3.12
38-
39-
- name: A4) Display versions
40-
run: |
41-
python --version
42-
uv --version
43-
uv pip list | head -n 50
45+
- name: A3) Install Python version 3.12
46+
run: uv python install 3.12
4447

45-
- name: A5) Sync to install dependencies
48+
- name: A4) Sync to install dependencies
4649
run: uv sync --extra dev --extra docs --upgrade
4750

4851
# === BASELINE CHECKS ===

.github/workflows/links.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
pull-requests: write
2828

2929
steps:
30-
- name: 1) Checkout repository code
31-
uses: actions/checkout@v6 # OBS: v6 current as of Dec 2025
30+
- name: A1) Checkout repository code
31+
uses: actions/checkout@v6
3232

3333
- name: 2) Check links with Lychee
3434
uses: lycheeverse/lychee-action@v2

.yamllint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# ============================================================
2+
# .yamllint.yml (YAML linting configuration)
3+
# ============================================================
4+
15
# WHY: Enforce YAML correctness without arbitrary style constraints.
26
# OBS: Default yamllint rules conflict with GitHub Actions YAML.
37
# Line length, document start, truthy, and comment spacing are intentionally disabled.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Denise M. Case
3+
Copyright (c) 2025-2026 Denise M. Case
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE)
44
[![Deploy Docs](https://github.com/structural-explainability/site/actions/workflows/deploy-docs.yml/badge.svg?branch=main)](https://github.com/structural-explainability/site/actions/workflows/deploy-docs.yml)
5+
![Build Status](https://github.com/structural-explainability/site/actions/workflows/ci-hygiene-mkdocs.yml/badge.svg?branch=main)
6+
[![Check Links](https://github.com/structural-explainability/site/actions/workflows/links.yml/badge.svg)](https://github.com/structural-explainability/site/actions/workflows/links.yml)
57
[![Dependabot](https://img.shields.io/badge/Dependabot-enabled-brightgreen.svg)](https://github.com/structural-explainability/site/security/dependabot)
68

79
> Documentation site for Structural Explainability.
@@ -18,16 +20,11 @@ Initialize once:
1820
```shell
1921
uv self update
2022
uv python pin 3.12
23+
uv sync --extra dev --extra docs --upgrade
24+
2125
uvx pre-commit install
26+
git add -A
2227
uvx pre-commit run --all-files
23-
24-
# Windows:
25-
.venv\Scripts\activate
26-
27-
# macOS/Linux:
28-
# source .venv/bin/activate
29-
30-
uv sync --extra dev --extra docs --upgrade
3128
```
3229

3330
Build and serve docs:

lychee.toml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,44 @@
1-
# WHY: Configures Lychee link checker behavior for CI/CD
2-
# OBS: Flat structure required by lychee v0.22+; no nested sections
1+
# ============================================================
2+
# lychee.toml (Lychee link checker configuration)
3+
# ============================================================
4+
5+
# REQ.PROJECT: Automatic link checking using GitHub Actions and Lychee.
6+
# WHY-FILE: Shared Lychee configuration (lychee.toml) for documentation-heavy repositories.
7+
# REQ: Link checking MUST be reliable and CI-safe.
8+
# WHY: Configures Lychee link checker behavior for CI/CD.
9+
# OBS: Flat structure required by lychee v0.22+; no nested sections.
10+
# OBS: No path exclusions; all documentation files are expected to be link-clean.
11+
# OBS: Link integrity preserves stable, reconstructible references over time.
12+
# OBS: Link integrity maintains connections to external resources.
313

414
# WHY: Control verbosity and CI-friendly output
5-
verbose = "info" # WHY: Balance between detail and noise
6-
no_progress = true # WHY: Progress bars don't work well in CI logs
15+
verbose = "info" # WHY: Balance between detail and noise
16+
no_progress = true # WHY: Progress bars don't work well in CI logs
717

818
# WHY: Performance tuning for link checking
9-
max_concurrency = 6 # WHY: Parallel requests without overwhelming servers
10-
max_retries = 3 # WHY: Retry flaky connections before failing
11-
retry_wait_time = 8 # WHY: Wait 8 seconds between retries
12-
timeout = 30 # WHY: 30 seconds per request before timeout
19+
max_concurrency = 6 # WHY: Parallel requests without overwhelming servers
20+
max_retries = 3 # WHY: Retry flaky connections before failing
21+
retry_wait_time = 8 # WHY: Wait 8 seconds between retries
22+
timeout = 30 # WHY: 30 seconds per request before timeout
1323

1424
# WHY: Accept common status codes that don't indicate broken links
1525
# OBS: 403 and 429 reduce false positives
1626
accept = [
17-
200, # OK
18-
206, # Partial content
19-
301, # Moved permanently
20-
302, # Found (temporary redirect)
21-
307, # Temporary redirect
22-
308, # Permanent redirect
23-
403, # Forbidden (often false positive)
24-
429, # Too many requests (rate limiting)
25-
503, # Service unavailable (temporary)
27+
200, # OK
28+
206, # Partial content
29+
301, # Moved permanently
30+
302, # Found (temporary redirect)
31+
307, # Temporary redirect
32+
308, # Permanent redirect
33+
403, # Forbidden (often false positive)
34+
429, # Too many requests (rate limiting)
35+
503, # Service unavailable (temporary)
2636
]
2737

2838
# WHY: Exclude patterns that shouldn't be checked
2939
exclude = [
30-
"example\\.com", # WHY: Exclude example domains in documentation
31-
"localhost", # WHY: Exclude local development URLs
32-
"127\\.0\\.0\\.1", # WHY: Exclude local loopback
33-
"\\.local", # WHY: Exclude local network domains
40+
"example\\.com", # WHY: Exclude example domains in documentation
41+
"localhost", # WHY: Exclude local development URLs
42+
"127\\.0\\.0\\.1", # WHY: Exclude local loopback
43+
"\\.local", # WHY: Exclude local network domains
3444
]

0 commit comments

Comments
 (0)