Skip to content

Commit 399b844

Browse files
committed
se std
1 parent 803124d commit 399b844

15 files changed

Lines changed: 244 additions & 306 deletions

.editorconfig

Lines changed: 105 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,122 @@
1-
# WHY: Ensures consistent formatting across editors and contributors
2-
# OBS: Default 4 spaces, but Markdown/YAML/JSON use 2
3-
# REQ: Keep this file for cross-platform formatting consistency
1+
# REQ.UNIVERSAL: All professional GitHub project repositories MUST include .editorconfig.
2+
# WHY: Establish a cross-editor baseline so diffs stay clean and formatting is consistent.
3+
# ALT: Repository may omit .editorconfig ONLY if formatting is enforced equivalently by CI and formatter tooling.
4+
# CUSTOM: Adjust indent_size defaults only if organizational standards change; keep stable across projects.
5+
# NOTE: Sections are ordered by editorial importance, not strict alphabetical order.
6+
# EditorConfig is documented at https://editorconfig.org
47

8+
[*.{editorconfig}]
59
root = true
610

11+
# === Global defaults (always apply) ===
12+
713
[*]
8-
charset = utf-8
14+
# WHY: Normalize line endings and encoding across Windows, macOS, and Linux.
915
end_of_line = lf
10-
indent_style = space
11-
indent_size = 4 # WHY: Python standard (PEP 8)
16+
charset = utf-8
17+
18+
# WHY: Newline at EOF avoids noisy diffs and tool warnings.
1219
insert_final_newline = true
20+
21+
# WHY: Remove accidental whitespace noise in diffs.
1322
trim_trailing_whitespace = true
1423

15-
# WHY: Markdown uses 2-space indents for nested lists
24+
# WHY: Default to 2 spaces for configs and markup; language-specific overrides follow.
25+
indent_style = space
26+
indent_size = 2
27+
28+
29+
# === Build systems (special rules) ===
30+
31+
[Makefile]
32+
# WHY: Makefiles require tabs.
33+
indent_style = tab
34+
35+
[*.mk]
36+
# WHY: Makefile includes require tabs.
37+
indent_style = tab
38+
39+
40+
# === Citation and metadata ===
41+
42+
[CITATION.cff]
43+
# WHY: Citation tooling expects stable YAML formatting.
44+
indent_size = 2
45+
indent_style = space
46+
47+
48+
# === Markup and documentation ===
49+
1650
[*.md]
51+
# WHY: Keep Markdown clean; use explicit <br> for hard line breaks.
1752
indent_size = 2
18-
trim_trailing_whitespace = false # WHY: Allows 2 spaces for line breaks
53+
trim_trailing_whitespace = true
1954

20-
# WHY: YAML/JSON tooling expects 2 spaces
21-
[*.{yml,yaml,json}]
55+
[*.{tex,cls,sty}]
56+
# WHY: LaTeX convention is 2 spaces.
2257
indent_size = 2
58+
indent_style = space
2359

24-
# WHY: JavaScript ecosystem standard is 2 spaces
25-
[*.{js,ts}]
60+
[*.xml]
61+
# WHY: XML convention is 2 spaces.
2662
indent_size = 2
63+
indent_style = space
64+
65+
[*.{yml,yaml}]
66+
# WHY: YAML convention is 2 spaces.
67+
indent_size = 2
68+
indent_style = space
69+
70+
71+
# === Data and configuration ===
72+
73+
[*.{json,jsonc,jsonl,ndjson}]
74+
# WHY: JSON tooling typically expects 2 spaces.
75+
indent_size = 2
76+
indent_style = space
2777

28-
# WHY: TOML follows Python convention (4 spaces)
2978
[*.toml]
79+
# WHY: TOML often follows 4-space indentation in many projects.
3080
indent_size = 4
81+
indent_style = space
82+
83+
84+
# === Programming languages ===
85+
86+
[*.{js,ts}]
87+
# WHY: JS/TS ecosystem commonly uses 2 spaces.
88+
indent_size = 2
89+
indent_style = space
90+
91+
[*.{py,pyi}]
92+
# WHY: Python convention is 4 spaces.
93+
indent_size = 4
94+
indent_style = space
95+
96+
[*.ps1]
97+
# WHY: PowerShell convention is 4 spaces.
98+
indent_size = 4
99+
indent_style = space
100+
101+
[*.{c,cpp,h,java,cs,go,rs}]
102+
# WHY: Many C-family and systems languages commonly use 4 spaces.
103+
indent_size = 4
104+
indent_style = space
105+
106+
[*.{sh,bash}]
107+
# WHY: Shell script convention is 2 spaces.
108+
indent_size = 2
109+
indent_style = space
110+
111+
112+
# === Proof assistants and formal languages ===
113+
114+
[*.lean]
115+
# WHY: Lean 4 convention is 2 spaces; matches Mathlib and stdlib style.
116+
indent_size = 2
117+
indent_style = space
118+
119+
[*.{v,vo}]
120+
# WHY: Coq convention is 2 spaces.
121+
indent_size = 2
122+
indent_style = space

.github/dependabot.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
# .github/dependabot.yml
1+
# 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.
5+
# ALT: Dependabot could be omitted if workflows are pinned and reviewed manually.
6+
# CUSTOM: Update interval if CI cadence or security posture changes.
7+
28
version: 2
9+
310
updates:
411
- package-ecosystem: "github-actions"
512
directory: "/"
13+
14+
# WHY: Monthly cadence balances stability with security updates.
15+
# ALT: Use "weekly" for higher-security environments.
616
schedule:
717
interval: "monthly"
18+
19+
# WHY: Clear commit prefix simplifies changelog review and filtering.
820
commit-message:
921
prefix: "(deps)"

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ name: CI (Docs Site)
1717

1818
on:
1919
push:
20-
branches: [ main ]
20+
branches: [main]
2121
pull_request:
22-
branches: [ main ]
22+
branches: [main]
2323
workflow_dispatch:
2424

2525
permissions:
@@ -64,4 +64,4 @@ jobs:
6464
uv run mkdocs build --strict
6565
else
6666
echo "No mkdocs config found; skipping docs build."
67-
fi
67+
fi

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: Docs Deploy (MkDocs Python)
77

88
on:
99
push:
10-
branches: [ main ]
10+
branches: [main]
1111
workflow_dispatch:
1212

1313
permissions:

.github/workflows/links.yml

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,40 @@
1-
# WHY: Automated link checking - behavior controlled by repo variable
2-
# OBS: Set IS_ACTIVE_REPO=true in GitHub Repository Settings > Secrets and variables > Actions > Variables
3-
# ALT: Default (no variable set) runs manual only - perfect for student repos
1+
# WHY-FILE: Automated link checking.
2+
# OBS: Behavior is configured in lychee.toml in this repository.
3+
# OBS: Runs on pull requests and monthly on schedule; manual trigger always available.
44

55
name: Check Links
66

77
on:
88
workflow_dispatch: # WHY: Manual trigger - always available
99

10-
schedule:
11-
- cron: "0 6 1 * *" # WHY: Runs monthly (1st of month) if IS_ACTIVE_REPO=true
10+
pull_request: # WHY: Validates PR links before merge
1211

13-
pull_request: # WHY: Validates PR links if IS_ACTIVE_REPO=true
12+
schedule:
13+
- cron: "0 6 1 * *" # WHY: Runs monthly (1st of month)
1414

15-
# WHY: Prevent multiple simultaneous link checks on same ref
1615
concurrency:
16+
# WHY: Prevent multiple simultaneous link checks on same ref
1717
group: link-check-${{ github.ref }}
1818
cancel-in-progress: true
1919

2020
jobs:
2121
lychee:
22-
# WHY: Skip scheduled/PR runs unless IS_ACTIVE_REPO=true or manual trigger
23-
# OBS: vars.IS_ACTIVE_REPO linted as error in VS Code but works on GitHub
24-
if: github.event_name == 'workflow_dispatch' || vars.IS_ACTIVE_REPO == 'true'
25-
2622
runs-on: ubuntu-latest
2723

28-
# WHY: Permissions needed for PR comments and issue creation
2924
permissions:
3025
contents: read
3126
issues: write
3227
pull-requests: write
3328

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

37-
# WHY: Check all documentation and config files for broken links
38-
- name: Check links with Lychee
39-
uses: lycheeverse/lychee-action@v2 # OBS: v2 current as of Dec 2025
33+
- name: 2) Check links with Lychee
34+
uses: lycheeverse/lychee-action@v2
4035
with:
4136
args: >
42-
--verbose
43-
--no-progress
37+
--config lychee.toml
4438
--user-agent "${{ github.repository }}/lychee"
4539
'./**/*.bib'
4640
'./**/*.md'
@@ -52,47 +46,49 @@ jobs:
5246
env:
5347
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5448

55-
# WHY: Provide helpful feedback on PRs with broken links
56-
- name: Comment on PR if links broken
49+
- name: 3) Comment on PR if links broken
5750
if: failure() && github.event_name == 'pull_request'
58-
uses: actions/github-script@v8 # OBS: v8 current as of Dec 2025
51+
uses: actions/github-script@v8
5952
with:
6053
script: |
61-
const comment = `## Link Check Results
62-
63-
Some links appear broken. Check the [workflow logs](${context.payload.repository.html_url}/actions/runs/${context.runId}) for details.`;
64-
65-
github.rest.issues.createComment({
54+
const runUrl = `${context.payload.repository.html_url}/actions/runs/${context.runId}`;
55+
const comment = [
56+
"## Link Check Results",
57+
"",
58+
`Some links appear broken. Check the workflow logs: ${runUrl}`,
59+
].join("\n");
60+
61+
await github.rest.issues.createComment({
6662
issue_number: context.issue.number,
6763
owner: context.repo.owner,
6864
repo: context.repo.repo,
69-
body: comment
65+
body: comment,
7066
});
7167
72-
# WHY: Track broken links found during scheduled checks
73-
# OBS: Only creates issue if none already open with 'broken-links' label
74-
- name: Create issue for scheduled failures
68+
- name: 4) Create issue for scheduled failures # WHY: Track broken links found during scheduled checks
69+
# OBS: Only creates issue if none already open with 'broken-links' label
7570
if: failure() && github.event_name == 'schedule'
76-
uses: actions/github-script@v8 # OBS: v8 current as of Dec 2025
71+
uses: actions/github-script@v8
7772
with:
7873
script: |
79-
const title = `Link Check Failed - ${new Date().toISOString().split('T')[0]}`;
80-
const body = `Weekly link check found broken links. [Check logs](${context.payload.repository.html_url}/actions/runs/${context.runId})`;
74+
const date = new Date().toISOString().split("T")[0];
75+
const title = `Link Check Failed - ${date}`;
76+
const runUrl = `${context.payload.repository.html_url}/actions/runs/${context.runId}`;
77+
const body = `Monthly link check found broken links.\n\nWorkflow logs: ${runUrl}`;
8178
82-
// WHY: Avoid duplicate issues
8379
const existing = await github.rest.issues.listForRepo({
8480
owner: context.repo.owner,
8581
repo: context.repo.repo,
86-
labels: 'broken-links',
87-
state: 'open'
82+
labels: "broken-links",
83+
state: "open",
8884
});
8985
9086
if (existing.data.length === 0) {
9187
await github.rest.issues.create({
9288
owner: context.repo.owner,
9389
repo: context.repo.repo,
94-
title: title,
95-
body: body,
96-
labels: ['maintenance', 'broken-links']
90+
title,
91+
body,
92+
labels: ["maintenance", "broken-links"],
9793
});
9894
}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ htmlcov/
6363
.ruff_cache/
6464

6565
# ----------------------------------------
66-
# Documentation (MkDocs) build output
66+
# Documentation (MkDocs) - build output
6767
# ----------------------------------------
6868
site/
6969

@@ -86,7 +86,7 @@ reports/
8686
coverage.xml
8787

8888
# generated by setuptools-scm
89-
src/python/src/civic_exchange_protocol/_version.py
89+
src/python/src/civic_evolution_protocol/_version.py
9090

9191
# ----------------------------------------
9292
# Storage (runtime pulled data snapshots)

0 commit comments

Comments
 (0)