Skip to content

Add rules replacing call-with-output-file with display-to-file#793

Merged
jackfirth merged 2 commits into
masterfrom
manual-display-to-file-rule
Jul 7, 2026
Merged

Add rules replacing call-with-output-file with display-to-file#793
jackfirth merged 2 commits into
masterfrom
manual-display-to-file-rule

Conversation

@jackfirth

@jackfirth jackfirth commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Fixes #673.

Adds two rules to the file-io-suggestions suite. A call-with-output-file
expression whose procedure just displays a value to the port is
rewritten to display-to-file, and one whose procedure consists of
displayln calls is rewritten to display-lines-to-file. The rules only
fire when the port is used as nothing but the last argument of the
display calls, and Resyntax's existing binding correctness check
discards the suggestions in modules that don't import racket/file.

Fixes #673.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resyntax analyzed 2 files in this pull request and found no issues.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.931% (+0.04%) from 93.896% — manual-display-to-file-rule into master

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resyntax analyzed 2 files in this pull request and found no issues.

@jackfirth jackfirth merged commit 5620d87 into master Jul 7, 2026
5 checks passed
@jackfirth jackfirth deleted the manual-display-to-file-rule branch July 7, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New rule: manual-display-to-file

2 participants