Skip to content

New rule: manual-display-to-file #673

@jackfirth

Description

@jackfirth

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))
--------------------

Metadata

Metadata

Assignees

Labels

autopilot-candidateThe Copilot Agent should attempt this during a scheduled Autopilot runnew lintIssues suggesting new lints or pull requests implementing new lints

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions