jackfirth / jackfirth/resyntax
New rule: `unnecessary-default-recommendations`
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 70
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the two #lang resyntax/test cases in this issue and review issue #587, since the proposed code block syntax is a dependency. The rule is done when the lone default-recommendations import is removed, while the import remains when another suite is also required, matching the supplied expected outputs.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100