resyntax icon indicating copy to clipboard operation
resyntax copied to clipboard

New rule: `manual-display-to-file`

Open jackfirth opened this issue 4 months ago • 0 comments

Rule summary

Code using call-with-output-file and display / displayln can use display-to-file / display-lines-to-file instead.

Test case

#lang resyntax/test

test: "original code should be refactorable to new code"
--------------------
#lang racket
(define (f path s)
  (call-with-output-file path
    (lambda (out)
      (displayln s out))))
====================
#lang racket
(define (f path s)
  (display-lines-to-file (list s) path))
--------------------

jackfirth avatar Oct 29 '25 10:10 jackfirth