diff --git a/.editorconfig b/.editorconfig index 2d9d4aa..22bb364 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,5 +14,9 @@ trim_trailing_whitespace = false [Makefile] indent_style = tab -[*.{py,go,java,kt}] +[*.{py,java,kt,rs,c,h,cpp,hpp,cs}] indent_size = 4 + +# gofmt formats with tabs, not spaces — don't fight it. +[*.go] +indent_style = tab diff --git a/.env.example b/.env.example index 085086c..db9f926 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,8 @@ # Never commit the .env file — it is listed in .gitignore. # ── Server ───────────────────────────────────────────── -PORT=3000 +# Only applies if this project runs a network service. Remove otherwise. +# PORT=3000 # HOST=0.0.0.0 # ── Database ──────────────────────────────────────────── diff --git a/.githooks/commit-msg b/.githooks/commit-msg index 3fac2ad..266a6c7 100755 --- a/.githooks/commit-msg +++ b/.githooks/commit-msg @@ -17,7 +17,7 @@ if ! echo "$SUBJECT" | grep -qE "$PATTERN"; then echo " Example: feat(auth): add refresh token rotation" echo "" echo " Allowed types: feat | fix | refactor | test | docs | chore | perf | ci" - echo " Subject must be lowercase and under 72 characters." + echo " Description must be under 72 characters." echo "" echo " Your message: $SUBJECT" echo "" diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 9aba653..0ca3196 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -43,21 +43,6 @@ body: validations: required: true - - type: dropdown - id: area - attributes: - label: Area - options: - - Frontend / UI - - Backend / API - - Database - - Authentication - - CI/CD - - Documentation - - Other - validations: - required: true - - type: textarea id: environment attributes: @@ -65,8 +50,8 @@ body: description: Your runtime versions. placeholder: | - OS: macOS 15 / Ubuntu 24.04 / Windows 11 - - Node: 22.x - - pnpm: 10.x + - Runtime: Node 22.x / Python 3.12 / Go 1.22 / etc. + - Package manager / build tool version (if applicable) - Browser (if applicable): Chrome 134 validations: required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 47bfcec..2c86259 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -30,21 +30,6 @@ body: label: Alternatives considered description: What other approaches did you consider? Why did you reject them? - - type: dropdown - id: area - attributes: - label: Area - options: - - Frontend / UI - - Backend / API - - Database - - Authentication - - Developer experience - - Documentation - - Other - validations: - required: true - - type: textarea id: context attributes: diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e74b055..db606f1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,18 +1,58 @@ version: 2 updates: - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "weekly" - cooldown: - default-days: 3 - groups: - minor-and-patch: - applies-to: version-updates - update-types: - - "minor" - - "patch" + # ── Application dependencies ───────────────────────────── + # Uncomment whichever package-ecosystem matches this project + # (https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem). + + # - package-ecosystem: "npm" # Node / JavaScript / TypeScript + # directory: "/" + # schedule: + # interval: "weekly" + # cooldown: + # default-days: 3 + # groups: + # minor-and-patch: + # applies-to: version-updates + # update-types: + # - "minor" + # - "patch" + + # - package-ecosystem: "pip" # Python + # directory: "/" + # schedule: + # interval: "weekly" + + # - package-ecosystem: "gomod" # Go + # directory: "/" + # schedule: + # interval: "weekly" + + # - package-ecosystem: "cargo" # Rust + # directory: "/" + # schedule: + # interval: "weekly" + + # - package-ecosystem: "maven" # Java (Maven) + # directory: "/" + # schedule: + # interval: "weekly" + + # - package-ecosystem: "gradle" # Java / Kotlin (Gradle) + # directory: "/" + # schedule: + # interval: "weekly" + + # - package-ecosystem: "composer" # PHP + # directory: "/" + # schedule: + # interval: "weekly" + + # - package-ecosystem: "bundler" # Ruby + # directory: "/" + # schedule: + # interval: "weekly" + # ── Always applicable, regardless of language ──────────── - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fea49c..5575b18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,9 @@ on: pull_request: branches: [main] +permissions: + contents: read + concurrency: group: ci-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index a1ec744..3541381 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -4,6 +4,9 @@ on: pull_request: branches: [main] +permissions: + contents: read + jobs: commitlint: name: Validate commit messages @@ -13,8 +16,19 @@ jobs: with: fetch-depth: 0 + # Reuses .githooks/commit-msg so there is a single source of truth for + # the Conventional Commits rule — no Node/commitlint install required, + # so this works the same for every language this template is used for. - name: Check commit messages - uses: wagoid/commitlint-github-action@v6 - with: - failOnWarnings: false - helpURL: https://www.conventionalcommits.org + run: | + set -e + chmod +x .githooks/commit-msg + FAILED=0 + for sha in $(git rev-list "${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"); do + git log -1 --format=%B "$sha" > /tmp/commit-msg + if ! .githooks/commit-msg /tmp/commit-msg; then + echo "::error::Commit $sha does not follow Conventional Commits" + FAILED=1 + fi + done + exit "$FAILED" diff --git a/README.md b/README.md index 5b16029..65c7eac 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,14 @@ + + [![CI](https://github.com/your-org/your-repo/actions/workflows/ci.yml/badge.svg)](https://github.com/your-org/your-repo/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) diff --git a/docs/developer-guide/faq.md b/docs/developer-guide/faq.md index e76874c..9b76b8e 100644 --- a/docs/developer-guide/faq.md +++ b/docs/developer-guide/faq.md @@ -21,15 +21,17 @@ Open a [Feature Request issue](../../../issues/new/choose) first to discuss the **Q: Tests are failing locally but passing in CI (or vice versa).** - Make sure your `.env` matches the values expected by the test suite -- Run `pnpm install --frozen-lockfile` to ensure your dependencies match the lockfile +- Reinstall dependencies from the lockfile to rule out a local drift + **Q: How do I run a single test file?** ```bash -pnpm vitest run path/to/your.test.ts +# Replace with your test runner's single-file invocation +# e.g. npm test -- path/to/file.test.ts / pytest path/to/test_file.py / go test ./path/... ``` -**Q: The build fails with type errors I didn't introduce.** -Pull the latest `main` and run `pnpm install` — a dependency may have been updated. +**Q: The build fails with errors I didn't introduce.** +Pull the latest `main` and reinstall dependencies — one may have been updated since you last built. --- diff --git a/docs/getting-started/README.md b/docs/getting-started/README.md index 05d9ca0..b0d23ef 100644 --- a/docs/getting-started/README.md +++ b/docs/getting-started/README.md @@ -60,7 +60,7 @@ This guide walks you through setting up the project locally for development. | Variable | Required | Default | Description | |----------|----------|---------|-------------| -| `PORT` | No | `3000` | Port the server listens on | +| `PORT` | No | `3000` | Port the server listens on (only if this project runs a network service; remove otherwise) | | | | | | ---