Some of you may already know this, but I've implemented a refactoring tool for Racket called Resyntax. It analyzes your code (must be written in #lang racket/base
) and suggests ways you can improve it. Here's an example of the changes it made when I ran it over a real-world package. To use Resyntax, install it in installation scope (this is very important!) using raco pkg install --installation resyntax
. Then you can run it at the command line. Here are some example commands:
- Analyze a file and print suggestions in the terminal:
resyntax analyze --file foo.rkt
- Analyze multiple files:
resyntax analyze --file foo.rkt --file bar.rkt
- Fix a file:
resyntax fix --file foo.rkt
- Fix a directory:
resyntax fix --directory path/to/some/dir
- Fix a locally-installed package:
resyntax fix --package mypackage
(the package should be installed with--link
option for this to work the way you expect)