resyntax icon indicating copy to clipboard operation
resyntax copied to clipboard

New rule: `unnecessary-default-recommendations`

Open jackfirth opened this issue 6 months ago • 0 comments

Rule summary

In #lang resyntax/test, the default behavior when no refactoring suite is specified with require: is to use default-recommendations. Therefore, a test file whose only require: statement is require: resyntax/default-recommendations default-recommendations can be omitted.

Test case

#lang resyntax/test

test: "default-recommendations import can be removed"
|--------------------
| #lang resyntax/test
| require: resyntax/default-recommendations default-recommendations
| header: - #lang racket
| test: "some test"
| - (and a (and b c))
| - (and a b c)
|====================
| #lang resyntax/test
| header: - #lang racket
| test: "some test"
| - (and a (and b c))
| - (and a b c)
|--------------------

No-change test case

#lang resyntax/test

no-change-test: "default recommendations import not removed when other imports present"
|--------------------
| #lang resyntax/test
| require: resyntax/default-recommendations default-recommendations
| require: resyntax/default-recommendations boolean-shortcuts
| header: - #lang racket
| test: "some test"
| - (and a (and b c))
| - (and a b c)
|--------------------

Additional context

This relies on #587. The test cases above use the code block syntax proposed in that issue.

jackfirth avatar Aug 21 '25 21:08 jackfirth