generated from jackfirth/racket-package-template
-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Labels
bugSomething isn't workingSomething isn't workingexisting lintIssues or pull requests relating to existing lintsIssues or pull requests relating to existing lints
Description
Problem summary
In racket/drracket#771, Resyntax suggested replacing (string-append ... (format ...)) with (format ...), but this produced very unpleasant code because the other arguments to string-append were also (format ...) expressions. The string-append-with-format-to-format rule shouldn't fire on expressions that append multiple format subexpressions together.
Test case for code that shouldn't be refactored
#lang resyntax/test
test: "this code should not be refactored"
--------------------
#lang racket
(string-append (format "foo: ~a" 42) (format ("bar: ~a" 42))
--------------------Unwanted suggestion
#lang racket
(format "~a\n~a~a~a\n\nCollections:\n~a\n~a"
(send environment get-value)
(format "Human Language: ~a\n" (send human-language get-value))
(format "(current-memory-use) ~a\n" (send memory-use get-value))
(format "raco pkg (show):\n~a\n" (send (send pkg-info get-editor) get-text))
(send (send collections get-editor) get-text)
(apply string-append
(for/list ([extra (in-list extras)])
(format "~a: ~a\n" (car extra) (send (cdr extra) get-value)))))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingexisting lintIssues or pull requests relating to existing lintsIssues or pull requests relating to existing lints