-
-
Notifications
You must be signed in to change notification settings - Fork 99
Automated Resyntax fixes #441
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
Conversation
This is an automated change generated by Resyntax. #### Pass 1 Applied 1 fix to [`scribble-test/tests/scribble/latex-render.rkt`](../blob/HEAD/scribble-test/tests/scribble/latex-render.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 3 fixes to [`scribble-lib/scribble/lp/lang/common.rkt`](../blob/HEAD/scribble-lib/scribble/lp/lang/common.rkt) * Line 7, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. * Line 44, `if-let-to-cond`: `cond` with internal definitions is preferred over `if` with `let`, to reduce nesting * Line 59, `map-to-for`: This `map` operation can be replaced with a `for/list` loop. Applied 1 fix to [`scribble-test/tests/scribble/text-wrap.rkt`](../blob/HEAD/scribble-test/tests/scribble/text-wrap.rkt) * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. #### Pass 2 Applied 1 fix to [`scribble-lib/scribble/lp/lang/common.rkt`](../blob/HEAD/scribble-lib/scribble/lp/lang/common.rkt) * Line 46, `if-begin-to-cond`: Using `cond` instead of `if` here makes `begin` unnecessary ## Summary Fixed 6 issues in 3 files. * Fixed 3 occurrences of `tidy-require` * Fixed 1 occurrence of `if-let-to-cond` * Fixed 1 occurrence of `map-to-for` * Fixed 1 occurrence of `if-begin-to-cond`
[else (list (shift expr))])] | ||
[else | ||
(define subs (syntax->list expr)) | ||
(if subs (list (restore expr (loop subs))) (list (shift expr)))])) |
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.
Kind of wish the if
were on its own line here. Not sure if this is already accounted for in a pending change elsewhere, tho!
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.
Sorawee and I have some thoughts on how to address this with some future fmt
changes. But for now I'd like to just let it be, since I don't think it's worth blocking the rest of the improvements on waiting for that.
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.
okay.
The changes look good to me, modulo the one comment. |
(append-map (lambda (m) | ||
(map (lambda (u) | ||
(list (syntax-local-introduce m) | ||
(syntax-local-introduce u))) | ||
(mapping-get chunk-groups m))) | ||
(for/list ([u (in-list (mapping-get chunk-groups m))]) | ||
(list (syntax-local-introduce m) (syntax-local-introduce u)))) |
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.
This can be simplified further. Filed jackfirth/resyntax#323 for this.
This is an automated change generated by Resyntax.
Pass 1
Applied 1 fix to
scribble-test/tests/scribble/latex-render.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Applied 3 fixes to
scribble-lib/scribble/lp/lang/common.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.if-let-to-cond
:cond
with internal definitions is preferred overif
withlet
, to reduce nestingmap-to-for
: Thismap
operation can be replaced with afor/list
loop.Applied 1 fix to
scribble-test/tests/scribble/text-wrap.rkt
tidy-require
: Keep imports inrequire
sorted and grouped by phase, with collections before files.Pass 2
Applied 1 fix to
scribble-lib/scribble/lp/lang/common.rkt
if-begin-to-cond
: Usingcond
instead ofif
here makesbegin
unnecessarySummary
Fixed 6 issues in 3 files.
tidy-require
if-let-to-cond
map-to-for
if-begin-to-cond