Skip to content

Code checks with judgment

Make good taste
enforceable.

Scruple catches problems linters miss. Use its built-in rules or write your own to turn your team's engineering judgment into checks that run on every change.

src/report.ts01 finding
1 export async function parseReport() {
2   const file = await open("report.txt");
3   const report = parse(await file.readFile("utf8"));
4   await file.close();
5   return report;
6 }

$ pnpm exec scruple src/report.ts

src/report.ts

1:8warningEnsure this resource is cleaned up when work fails. (96%)resources/require-cleanup-on-failure

relevant code onlyfixed warning
01

Find the right code

Rules inspect bounded parser targets and can ask the provider to resolve ambiguous candidates.

02

Apply a written standard

Each rule asks one clear question with defined answers.

03

Return a normal warning

Rules control the message, severity, and source location.

Where Scruple fits

Different tools catch
different problems.

Compiler and linter

Catch errors the code can prove.

settings.ts
const seats: number = "12";

Type error String is not assignable to number.

Scruple

Catch valid code that breaks a written standard.

users.test.ts
test("creates a user", async () => {
  await createUser();
});

Scruple warning This test does not verify behavior.

Reviewers

Catch choices that depend on context outside the file.

checkout.ts
export const checkoutRollout = 100;

Review comment The launch plan starts at 5%, not 100%.

AI decision models

Use AI for one narrow
decision at a time.

Scruple does not ask a chatbot to review your repository. A rule can ask whether a bounded target is relevant, then sends each selected candidate with one fixed decision question.

Recommended

Jev

Best overall across strict accuracy, diagnostics, recall, F1, throughput, and API cost in Scruple's 187-fixture evaluation.

Configuration

import {
  jevProvider,
} from "@scruple/provider-jev";

const provider = jevProvider({
  apiKey:
    process.env["TYPESAFE_API_KEY"]!,
});
Read the Jev guide

Custom rules

Put your team's taste
in the repository.

Every team has standards that live in review comments. Scruple turns those repeated comments into named, tested rules that run the same way on every change.

Write a rule

errors“We preserve the original error here.”

tests“This test does not prove the behavior.”

resources“Retries need a deadline.”

comments“Explain why, not what.”

If a review comment starts with “we usually,” it may belong in a Scruple rule.

Start with built-in rules

Spend review time on decisions
that are still worth discussing.

Released under the MIT License.