Skip to content

New rule: unnecessary-default-recommendations #588

@jackfirth

Description

@jackfirth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new lintIssues suggesting new lints or pull requests implementing new lintstestingTests and testing tools

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions