diff --git a/.github/workflows/org-lint.yml b/.github/workflows/org-lint.yml new file mode 100644 index 0000000..4b528b6 --- /dev/null +++ b/.github/workflows/org-lint.yml @@ -0,0 +1,29 @@ +# Org-required lint. The openNTL org ruleset names this file in a +# "Require workflows to pass" rule, so GitHub runs it on every pull request +# in every repo in the org — no per-repo .github/workflows/lint.yml needed. +# +# The job is called `lint` and calls nyuchi/.github's reusable workflow, so +# its checks publish as the same five contexts as the per-repo caller: +# lint / actionlint, lint / JSON validity, lint / prettier, +# lint / markdownlint, lint / yamllint +# +# A repo's own .prettierrc, .prettierignore, .markdownlint.jsonc and +# .yamllint.yaml at its root always win. Where one is missing, the reusable +# workflow falls back to the canonical copy in nyuchi/.github. + +name: Org lint + +on: + pull_request: + merge_group: + +concurrency: + group: org-lint-${{ github.repository }}-${{ github.ref }} + cancel-in-progress: true + +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..29c3bef --- /dev/null +++ b/.markdownlint.jsonc @@ -0,0 +1,39 @@ +// markdownlint-cli2 config for openNTL/.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..b65e3ea --- /dev/null +++ b/.prettierignore @@ -0,0 +1,30 @@ +# Prettier ignore for openNTL/.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..4860845 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,82 @@ +# yamllint config for openNTL/.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 + + # Rails fixtures are ERB TEMPLATES, not YAML documents. campfire's + # test/fixtures/users.yml opens with + # <% password_digest = BCrypt::Password.create("secret123456") %> + # and only becomes valid YAML after Rails renders it, so yamllint + # reports a hard syntax error and always will. The ActionText fixtures + # alongside them are HTML blobs that tests assert on byte-for-byte, so + # rewrapping their long lines would be a test change, not a formatting + # change. Seven files in that repo are ERB-templated YAML; the others + # only parse because their ERB happens to sit inside quoted scalars, + # which is luck rather than correctness. + test/fixtures/ + **/test/fixtures/ + +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/README.md b/README.md index 8404ae8..122f83a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # .github -Organisation profile and default community health files for openNTL + +Organisation profile and default community health files for openNTL.