2 pointsby jbrown95135 hours ago1 comment
  • jbrown95135 hours ago
    I built Perch, an open-source (MIT) semantic linter that allows you to write linting rules in English. Perch reads every method a rule applies to and gives you a confidence score for how likely each one is to break it.

    With AI coding, I find unit tests almost worthless, coding agents will always make them pass and hide regressions/defects by wrapping code in a try/catch, undoing fixes I made in previous weeks, or removing access checks and mocking them in a test. Normal linters can't catch this, because it requires understanding what the function is doing.

    Here's a rule that catches the empty list thing: - name: errors-reach-the-caller where: "src/*/*.js" each: method min: 80 ensure: >- Every catch block and .catch() callback rethrows the error and returns it to the caller

    Each method goes to a decision model along with its callers and callees. Responses are cached, so if the code doesn't change, rescanning is free. I also added default rules for bug scanning and top 25 CWE, it works pretty well at finding bugs in your PRs, and is a fraction of the cost of AI PR bots.

    npm install -g @lakeday/perch