From ee5f2cde8394a49cd7556f7718cb1ffd63825e2d Mon Sep 17 00:00:00 2001 From: Bryan Fawcett Date: Sat, 12 Sep 2026 03:02:20 +0800 Subject: [PATCH] ci: adopt the canonical org lint gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This repo published none of the five `lint / *` contexts the nyuchi org ruleset requires on the default branch, so nothing could merge. .github/workflows/lint.yml is now the canonical thin caller for nyuchi/.github/.github/workflows/reusable-lint.yml. The job is named `lint` and calls a reusable, so the checks publish as `lint / ` — exactly the five required strings. Config files added, byte-identical to nyuchi/.github: .prettierrc, .prettierignore, .markdownlint.jsonc, .yamllint.yaml, .editorconfig. actionlint, JSON validity and yamllint were already clean. markdownlint found two MD031 blanks-around-fences issues in packages/ui/BUILDING.md, auto-fixed, and prettier reformatted two more markdown files. No hand fixes were needed. This repo carries a pnpm-lock.yaml, which the canonical .yamllint.yaml now ignores alongside package-lock.json and yarn.lock — lockfiles are generated, and pnpm copies registry deprecation notices into them verbatim at lengths no one can rewrap. Verified locally with CI's exact pinned versions (actionlint 1.7.12, prettier 3.9.4, markdownlint-cli2 0.23.2, yamllint 1.38.0): all five clean. Co-Authored-By: Claude Opus 5 (1M context) --- .editorconfig | 40 ++++++++++++++++++++ .github/workflows/lint.yml | 54 +++++++++++++++++++++++++++ .markdownlint.jsonc | 39 ++++++++++++++++++++ .prettierignore | 30 +++++++++++++++ .prettierrc | 16 ++++++++ .yamllint.yaml | 69 +++++++++++++++++++++++++++++++++++ packages/bundu-ui/BUILDING.md | 10 ++--- packages/ui/BUILDING.md | 2 + packages/ui/README.md | 10 ++--- 9 files changed, 260 insertions(+), 10 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/lint.yml create mode 100644 .markdownlint.jsonc create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 .yamllint.yaml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f4c7245 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,40 @@ +# EditorConfig — https://editorconfig.org +# Keeps whitespace consistent across editors and IDEs before +# Prettier / rustfmt / ruff get a chance to run. + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +# Markdown: trailing spaces are significant (hard line-break). +# Let Prettier handle wrapping; don't trim here. +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 + +[*.{json,jsonc}] +indent_size = 2 + +[*.toml] +indent_size = 4 + +[Makefile] +indent_style = tab + +[*.rs] +# rustfmt handles Rust formatting; EditorConfig just sets the baseline. +indent_size = 4 + +[*.py] +indent_size = 4 + +[*.{cpp,cc,c,h,hpp}] +indent_size = 4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..5e71cb6 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,54 @@ +# The org-wide lint gate. Drop this file in as +# .github/workflows/lint.yml and change nothing else. +# +# The five checks it publishes are exactly the five contexts the +# org ruleset requires: +# +# lint / actionlint +# lint / JSON validity +# lint / prettier +# lint / markdownlint +# lint / yamllint +# +# Those strings come from the job being called `lint` and calling a +# reusable workflow - a check publishes as " / ". +# Do NOT convert this to a matrix: a matrix publishes +# "lint (actionlint)" instead and will not satisfy the ruleset. +# +# Also copy .prettierrc, .prettierignore, .markdownlint.jsonc and +# .yamllint.yaml from nyuchi/.github into your repo root. + +name: Lint + +on: + pull_request: + push: + # Every default-branch name in the estate: `main` covers 68 repos, + # `master` covers siafudb-kuzu, `scaffold` covers shamwari-core, + # shamwari-gateway and shamwari-web. Drop a name and merging to that + # repo's default branch fires nothing, so the five contexts never + # land on the default-branch head - which is how `lint / prettier` + # stayed red in bundu-labs/.github from 2026-05-02 unnoticed. + # + # A list rather than a bare `push:`, because unfiltered push would + # run the gate on every feature-branch push in 74 repos and bill it + # twice per PR. Add a name here if a repo ever adopts a fourth. + branches: [main, master, scaffold] + # Required for repos whose ruleset uses a MERGE QUEUE: required checks + # must report on the gh-readonly-queue/** ref, and only merge_group + # produces that. Without it a queued PR stalls for the full + # check_response_timeout and nothing can ever land. Harmless where + # there is no queue, so it stays in the one identical caller. + merge_group: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +permissions: + contents: read + +jobs: + lint: + uses: nyuchi/.github/.github/workflows/reusable-lint.yml@main diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc new file mode 100644 index 0000000..1a3974c --- /dev/null +++ b/.markdownlint.jsonc @@ -0,0 +1,39 @@ +// markdownlint-cli2 config for nyuchi/.github. +// +// Relaxed defaults that accommodate: +// - Long prose lines in docs (we format for readability, not width) +// - Inline HTML in the org profile (
) +// - Files that start with an HTML comment or a
instead of an H1 +// - Fenced code blocks without a language tag +// +// See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md +{ + "default": true, + + // Line length — we wrap for readability, not at a fixed column. + "MD013": false, + + // Inline HTML — profile/README.md uses
for the + // landing-page layout and that's intentional. + "MD033": false, + + // First line must be a top-level heading — profile/README.md opens + // with an HTML comment, which is correct. + "MD041": false, + + // Fenced code blocks without a language — acceptable for output + // blocks and plain-text fences. + "MD040": false, + + // Duplicate headings are fine as long as they aren't siblings + // (e.g. "## Summary" appears in multiple docs; that's expected). + "MD024": { "siblings_only": true }, + + // Unordered list indentation — 2 spaces, matching our house style. + "MD007": { "indent": 2 }, + + // Table-column-style — re-enabled now that Prettier is in CI and + // auto-formats tables. Prettier's table output should satisfy + // MD060's "aligned" style. + "MD060": true, +} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..b8d69cf --- /dev/null +++ b/.prettierignore @@ -0,0 +1,30 @@ +# Prettier ignore for nyuchi/.github. + +# Standard ignores +node_modules/ +.git/ + +# Files with structural meaning that Prettier would harm +LICENSE +CODEOWNERS +CODEOWNERS.example +.github/CODEOWNERS + +# YAML is handled by yamllint and actionlint, not Prettier — they have +# stronger guarantees about GitHub Actions semantics that Prettier does +# not understand (e.g. the `on:` truthy quirk). +*.yml +*.yaml + +# Governance documents are authored by the Founder as legal / formal +# documents. Prettier's markdown formatter reflows numbered paragraphs +# ("2.2 The company pursues...") after a list as loose list-item +# continuations, which corrupts the document's structure. Hand-format +# these files. +profile/governance/ + +# Lockfiles, generated output +*-lock.json +*-lock.yaml +package-lock.json +pnpm-lock.yaml diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..333987c --- /dev/null +++ b/.prettierrc @@ -0,0 +1,16 @@ +{ + "printWidth": 80, + "proseWrap": "preserve", + "tabWidth": 2, + "useTabs": false, + "endOfLine": "lf", + "trailingComma": "all", + "overrides": [ + { + "files": ["*.md", "*.mdx"], + "options": { + "embeddedLanguageFormatting": "off" + } + } + ] +} diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..dc117fc --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,69 @@ +# yamllint config for nyuchi/.github. +# +# Relaxed defaults that accommodate: +# - GitHub Actions workflows (which use `on:` — a YAML 1.1 boolean) +# - Long lines in shell heredocs and comment blocks inside workflows +# - Files without `---` document-start markers +# +# See https://yamllint.readthedocs.io/en/stable/configuration.html + +extends: default + +ignore: | + node_modules/ + # Lockfiles are generated, not authored. .prettierignore already + # exempts them under "Lockfiles, generated output"; yamllint not doing + # the same was an oversight that only stayed hidden because this repo + # has no lockfile. pnpm writes registry deprecation notices verbatim + # into pnpm-lock.yaml, which routinely exceeds the 140-char limit and + # cannot be rewrapped without invalidating the lockfile. + pnpm-lock.yaml + package-lock.json + yarn.lock + **/pnpm-lock.yaml + **/package-lock.json + **/yarn.lock + +rules: + # 140-char limit. Workflow files have legitimately long shell URLs + # (the actionlint download script, action references) and issue- + # template `about:` strings render as a single line in the picker, + # so wrapping them would change user-visible behaviour. 140 is + # tight enough to flag truly excessive lines without forcing + # awkward breaks on URLs. Strict CI fails on any violation. + line-length: + max: 140 + level: error + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + + # GitHub Actions uses `on:` as a key, which YAML 1.1 treats as a + # boolean. Disable the truthy check on keys to stop yamllint from + # rejecting every workflow. + truthy: + check-keys: false + level: error + + # We don't prefix YAML files with `---`. + document-start: disable + + # Be lenient about how many spaces follow `#` in comments. + comments: + min-spaces-from-content: 1 + + # Comments-indentation flags standalone comments that don't match the + # indent of surrounding content. Real-world configs use comments to + # delimit sections (long `# ----` separator banners) and to mark + # commented-out blocks at the level of the code they replace, neither + # of which fits the rule cleanly. Disabled. + comments-indentation: disable + + # GitHub issue forms have deeply nested lists and mappings. + indentation: + spaces: 2 + indent-sequences: consistent + + # Stops a warning on the trailing-empty-line check for files that + # end cleanly with a single newline. + empty-lines: + max-end: 1 diff --git a/packages/bundu-ui/BUILDING.md b/packages/bundu-ui/BUILDING.md index 8a0792a..5c6adaf 100644 --- a/packages/bundu-ui/BUILDING.md +++ b/packages/bundu-ui/BUILDING.md @@ -17,11 +17,11 @@ your site's primary mineral. Order matters: the brand overlay must come **after* @import "@bundu/ui/styles/brand-nyuchi.css"; ``` -| Overlay | Brand | Primary mineral | -| -------------------- | ------- | --------------- | -| `brand-bundu.css` | bundu | terracotta | -| `brand-nyuchi.css` | nyuchi | gold | -| `brand-mukoko.css` | mukoko | tanzanite | +| Overlay | Brand | Primary mineral | +| ------------------ | ------ | --------------- | +| `brand-bundu.css` | bundu | terracotta | +| `brand-nyuchi.css` | nyuchi | gold | +| `brand-mukoko.css` | mukoko | tanzanite | `globals.css` alone defaults `--primary` / `--ring` to **cobalt** — the canonical Mzizi default — so it's usable without any overlay. diff --git a/packages/ui/BUILDING.md b/packages/ui/BUILDING.md index f2a5cdd..22c5477 100644 --- a/packages/ui/BUILDING.md +++ b/packages/ui/BUILDING.md @@ -32,9 +32,11 @@ pnpm --filter @nyuchi/ui check # svelte-check (0 errors, 0 warnings) - **No raw hex in components.** `src/lib/**` uses semantic-token utility classes only (`bg-primary`, `text-muted-foreground`, `bg-cobalt-container`, …). Hex literals live solely in the token CSS and preset. Enforce with: + ```sh grep -rnE '#[0-9a-fA-F]{3,8}\b' src/ # must return nothing ``` + - **Accessibility.** ARIA roles + keyboard support on interactive components; a ≥48px minimum touch target (`min-h-12`); pill-shaped buttons (`rounded-full`). diff --git a/packages/ui/README.md b/packages/ui/README.md index 8286442..59b2bac 100644 --- a/packages/ui/README.md +++ b/packages/ui/README.md @@ -41,11 +41,11 @@ import "@nyuchi/ui/styles/brand-nyuchi.css"; // gold primary (or brand-bundu / and `@layer` component/utility classes. The canonical `--primary` / `--ring` mineral is **cobalt**; a brand overlay remaps them: -| Overlay | Primary mineral | -| ------------------- | --------------- | -| `brand-bundu.css` | terracotta | -| `brand-nyuchi.css` | gold | -| `brand-mukoko.css` | tanzanite | +| Overlay | Primary mineral | +| ------------------ | --------------- | +| `brand-bundu.css` | terracotta | +| `brand-nyuchi.css` | gold | +| `brand-mukoko.css` | tanzanite | ### Tailwind consumers