generated from jackfirth/racket-package-template
-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Labels
autopilot-candidateThe Copilot Agent should attempt this during a scheduled Autopilot runThe Copilot Agent should attempt this during a scheduled Autopilot runnew lintIssues suggesting new lints or pull requests implementing new lintsIssues suggesting new lints or pull requests implementing new lints
Description
Rule summary
The error function is easy to use in ways that violate Racket's error messages conventions. Most uses of it would be better off using raise-arguments-error. Resyntax should detect uses of error that are easy to migrate to raise-arguments-error.
Test case
#lang resyntax/test
test: "original code should be refactorable to new code"
--------------------
#lang racket
(define (foo low high)
(unless (<= low high)
(error 'foo "low should be less than high, ~a ~a" low high))
(void))
====================
#lang racket
(define (foo low high)
(unless (<= low high)
(raise-arguments-error 'foo "low should be less than high" "low" low "high" high))
(void))
--------------------Copilot
Metadata
Metadata
Assignees
Labels
autopilot-candidateThe Copilot Agent should attempt this during a scheduled Autopilot runThe Copilot Agent should attempt this during a scheduled Autopilot runnew lintIssues suggesting new lints or pull requests implementing new lintsIssues suggesting new lints or pull requests implementing new lints