-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automated Resyntax fixes #1402
base: master
Are you sure you want to change the base?
Automated Resyntax fixes #1402
Conversation
This is an automated change generated by Resyntax. #### Pass 1 Applied 3 fixes to [`typed-racket-lib/typed-racket/base-env/annotate-classes.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/annotate-classes.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. * Line 172, `if-else-false-to-and`: This `if` expression can be refactored to an equivalent expression using `and`. * Line 331, `define-values-values-to-define`: This use of `define-values` is unnecessary. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/ann-inst.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/ann-inst.rkt) * Line 8, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-test/optimizer/reset-port.rkt`](../blob/HEAD/typed-racket-test/optimizer/reset-port.rkt) * Line 8, `read-line-any`: Specify a line mode of `'any` with `read-line` to avoid differences between Windows and other platforms. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/base-env-indexing-abs.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-env-indexing-abs.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 3 fixes to [`typed-racket-test/optimizer/transform.rkt`](../blob/HEAD/typed-racket-test/optimizer/transform.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. * Line 24, `read-line-any`: Specify a line mode of `'any` with `read-line` to avoid differences between Windows and other platforms. * Line 35, `if-begin-to-cond`: Using `cond` instead of `if` here makes `begin` unnecessary Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/prims-lambda.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/prims-lambda.rkt) * Line 9, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/base-env-indexing.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-env-indexing.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/unit-prims.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/unit-prims.rkt) * Line 136, `map-to-for`: This `map` operation can be replaced with a `for/list` loop. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/base-structs.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-structs.rkt) * Line 14, `provide-deduplication`: Providing the same identifier multiple times is unnecessary. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/class-prims.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/class-prims.rkt) * Line 5, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-test/optimizer/known-bugs.rkt`](../blob/HEAD/typed-racket-test/optimizer/known-bugs.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 2 fixes to [`typed-racket-lib/typed-racket/base-env/base-contracted.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-contracted.rkt) * Line 6, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. * Line 34, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/class-clauses.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/class-clauses.rkt) * Line 8, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/optimizer/sequence.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/sequence.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/extra-env-lang.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/extra-env-lang.rkt) * Line 9, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/for-clauses.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/for-clauses.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/base-special-env.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-special-env.rkt) * Line 5, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/env-lang.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/env-lang.rkt) * Line 5, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`typed-racket-lib/typed-racket/base-env/base-types-extra.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/base-env/base-types-extra.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 2 fixes to [`typed-racket-test/optimizer/run.rkt`](../blob/HEAD/typed-racket-test/optimizer/run.rkt) * Line 2, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. * Line 14, `read-line-any`: Specify a line mode of `'any` with `read-line` to avoid differences between Windows and other platforms. ## Summary Fixed 26 issues in 20 files. * Fixed 18 occurrences of `tidy-require` * Fixed 3 occurrences of `read-line-any` * Fixed 1 occurrence of `if-begin-to-cond` * Fixed 1 occurrence of `if-else-false-to-and` * Fixed 1 occurrence of `define-values-values-to-define` * Fixed 1 occurrence of `map-to-for` * Fixed 1 occurrence of `provide-deduplication`
It would be helpful in the future to group changes by rule (either into separate commits in a PR, separate PRs, separate parts of the PR description, etc). |
That's possible but very tricky because multiple passes are made in a single pull request. So it might be the case that it's not possible to split up the changes into individual commits by rule type. |
@@ -5,7 +5,7 @@ | |||
(provide read-syntax) | |||
|
|||
(define (read-syntax name port) | |||
(read-line port) | |||
(read-line port 'any) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know 'any
is preferable in general, but does it break anything here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it's just for testing. Probably doesn't matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resyntax rules strive to preserve intended behavior, rather than actual behavior. So unless the original author of this code intended it to behave differently across platforms, I'm fine with relying on the CI signal to determine if this change is appropriate. And if that was intentional, I'm of the opinion that writing out (read-line port 'linefeed)
explicitly and including a comment is a better way to do that.
This is an automated change generated by Resyntax.
Pass 1
Applied 3 fixes to
typed-racket-lib/typed-racket/base-env/annotate-classes.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.if-else-false-to-and
: Thisif
expression can be refactored to an equivalent expression usingand
.define-values-values-to-define
: This use ofdefine-values
is unnecessary.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/ann-inst.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 1 fix to
typed-racket-test/optimizer/reset-port.rkt
read-line-any
: Specify a line mode of'any
withread-line
to avoid differences between Windows and other platforms.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/base-env-indexing-abs.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 3 fixes to
typed-racket-test/optimizer/transform.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.read-line-any
: Specify a line mode of'any
withread-line
to avoid differences between Windows and other platforms.if-begin-to-cond
: Usingcond
instead ofif
here makesbegin
unnecessaryApplied 1 fix to
typed-racket-lib/typed-racket/base-env/prims-lambda.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/base-env-indexing.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/unit-prims.rkt
map-to-for
: Thismap
operation can be replaced with afor/list
loop.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/base-structs.rkt
provide-deduplication
: Providing the same identifier multiple times is unnecessary.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/class-prims.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 1 fix to
typed-racket-test/optimizer/known-bugs.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 2 fixes to
typed-racket-lib/typed-racket/base-env/base-contracted.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/class-clauses.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 1 fix to
typed-racket-lib/typed-racket/optimizer/sequence.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/extra-env-lang.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/for-clauses.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/base-special-env.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/env-lang.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 1 fix to
typed-racket-lib/typed-racket/base-env/base-types-extra.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 2 fixes to
typed-racket-test/optimizer/run.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.read-line-any
: Specify a line mode of'any
withread-line
to avoid differences between Windows and other platforms.Summary
Fixed 26 issues in 20 files.
tidy-require
read-line-any
if-begin-to-cond
if-else-false-to-and
define-values-values-to-define
map-to-for
provide-deduplication