From 09812237d5fc8372ffecaf681d3a7552134257db Mon Sep 17 00:00:00 2001 From: hazre Date: Mon, 2 Mar 2026 20:14:21 +0100 Subject: [PATCH 1/3] ci: add format, lint, and typecheck quality checks --- .github/workflows/quality-checks.yml | 66 ++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/quality-checks.yml diff --git a/.github/workflows/quality-checks.yml b/.github/workflows/quality-checks.yml new file mode 100644 index 00000000..aeaa45bd --- /dev/null +++ b/.github/workflows/quality-checks.yml @@ -0,0 +1,66 @@ +name: Quality checks + +on: + pull_request: + push: + +jobs: + format: + name: Format check + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Setup node + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version-file: '.node-version' + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Check formatting + run: npm run fmt:check + + lint: + name: Lint + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Setup node + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version-file: '.node-version' + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run ESLint + run: npm run lint + + typecheck: + name: Typecheck + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Setup node + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version-file: '.node-version' + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run TypeScript typecheck + run: npm run typecheck -- --pretty false From 1cfecbb816e4a7dd51265b0d1185dac9cf1e80c7 Mon Sep 17 00:00:00 2001 From: hazre Date: Mon, 2 Mar 2026 20:29:43 +0100 Subject: [PATCH 2/3] docs: require quality checks before merging pull requests --- CONTRIBUTING.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b9812722..62a49325 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,6 +37,13 @@ It is not always possible to phrase every change in such a manner, but it is des Also, we use [ESLint](https://eslint.org/) for clean and stylistically consistent code syntax, so make sure your pull request follow it. +**Pull requests are not merged unless all quality checks are passing.** At minimum, `format`, `lint`, `typecheck`, and `knip` must all be green before a pull request can be merged. Run these locally before opening or updating a pull request: + +- `npm run fmt:check` +- `npm run lint` +- `npm run typecheck` +- `npm run knip` + **For any query or design discussion, join our [Matrix room](https://matrix.to/#/#sable:sable.moe).** ## Helpful links From d68003d8dcad9ca783792749cd1a30ff1aac5626 Mon Sep 17 00:00:00 2001 From: hazre Date: Mon, 2 Mar 2026 20:30:04 +0100 Subject: [PATCH 3/3] ci: add knip to quality checks workflow --- .github/workflows/quality-checks.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/quality-checks.yml b/.github/workflows/quality-checks.yml index aeaa45bd..fb8e582c 100644 --- a/.github/workflows/quality-checks.yml +++ b/.github/workflows/quality-checks.yml @@ -64,3 +64,23 @@ jobs: run: npm ci - name: Run TypeScript typecheck run: npm run typecheck -- --pretty false + + knip: + name: Knip + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Setup node + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version-file: '.node-version' + cache: 'npm' + - name: Install dependencies + run: npm ci --ignore-scripts + - name: Run Knip + run: npm run knip