Skip to content
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 #1400

Merged
merged 2 commits into from
Oct 9, 2024
Merged

Automated Resyntax fixes #1400

merged 2 commits into from
Oct 9, 2024

Conversation

resyntax-ci[bot]
Copy link
Contributor

@resyntax-ci resyntax-ci bot commented Oct 5, 2024

This is an automated change generated by Resyntax.

Pass 1

Applied 2 fixes to typed-racket-lib/typed-racket/optimizer/optimizer.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 92, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.

Applied 2 fixes to typed-racket-lib/typed-racket/optimizer/pair.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 77, datum->syntax-migration: The fifth argument to datum->syntax is ignored.

Applied 1 fix to typed-racket-lib/typed-racket/optimizer/vector.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/optimizer/fixnum.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 127, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.

Applied 2 fixes to typed-racket-lib/typed-racket/optimizer/float.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 139, or-in-for/and-to-filter-clause: The or expression in this for loop can be replaced by a filtering clause.

Applied 2 fixes to typed-racket-lib/typed-racket/optimizer/float-complex.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 85, if-let-to-cond: cond with internal definitions is preferred over if with let, to reduce nesting

Applied 1 fix to typed-racket-lib/typed-racket/optimizer/struct.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/optimizer/unboxed-tables.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/optimizer/list.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/optimizer/number.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/optimizer/box.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/optimizer/hidden-costs.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/optimizer/numeric-utils.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.

Applied 3 fixes to typed-racket-lib/typed-racket/optimizer/logging.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 93, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 104, map-to-for: This map operation can be replaced with a for/list loop.

Applied 1 fix to typed-racket-lib/typed-racket/optimizer/dead-code.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/optimizer/apply.rkt

  • Line 2, 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/extflonum.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/optimizer/utils.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 53, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.

Applied 1 fix to typed-racket-lib/typed-racket/optimizer/string.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/optimizer/unboxed-let.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.

Summary

Fixed 28 issues in 20 files.

  • Fixed 20 occurrences of tidy-require
  • Fixed 4 occurrences of let-to-define
  • Fixed 1 occurrence of datum->syntax-migration
  • Fixed 1 occurrence of or-in-for/and-to-filter-clause
  • Fixed 1 occurrence of if-let-to-cond
  • Fixed 1 occurrence of map-to-for

This is an automated change generated by Resyntax.

#### Pass 1

Applied 2 fixes to [`typed-racket-lib/typed-racket/optimizer/optimizer.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/optimizer.rkt)

  * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.
  * Line 92, `let-to-define`: Internal definitions are recommended instead of `let` expressions, to reduce nesting.

Applied 2 fixes to [`typed-racket-lib/typed-racket/optimizer/pair.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/pair.rkt)

  * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.
  * Line 77, `datum->syntax-migration`: The fifth argument to `datum->syntax` is ignored.

Applied 1 fix to [`typed-racket-lib/typed-racket/optimizer/vector.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/vector.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/optimizer/fixnum.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/fixnum.rkt)

  * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.
  * Line 127, `let-to-define`: Internal definitions are recommended instead of `let` expressions, to reduce nesting.

Applied 2 fixes to [`typed-racket-lib/typed-racket/optimizer/float.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/float.rkt)

  * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.
  * Line 139, `or-in-for/and-to-filter-clause`: The `or` expression in this `for` loop can be replaced by a filtering clause.

Applied 2 fixes to [`typed-racket-lib/typed-racket/optimizer/float-complex.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/float-complex.rkt)

  * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.
  * Line 85, `if-let-to-cond`: `cond` with internal definitions is preferred over `if` with `let`, to reduce nesting

Applied 1 fix to [`typed-racket-lib/typed-racket/optimizer/struct.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/struct.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/optimizer/unboxed-tables.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/unboxed-tables.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/optimizer/list.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/list.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/optimizer/number.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/number.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/optimizer/box.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/box.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/optimizer/hidden-costs.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/hidden-costs.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/optimizer/numeric-utils.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/numeric-utils.rkt)

  * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.

Applied 3 fixes to [`typed-racket-lib/typed-racket/optimizer/logging.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/logging.rkt)

  * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.
  * Line 93, `let-to-define`: Internal definitions are recommended instead of `let` expressions, to reduce nesting.
  * Line 104, `map-to-for`: This `map` operation can be replaced with a `for/list` loop.

Applied 1 fix to [`typed-racket-lib/typed-racket/optimizer/dead-code.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/dead-code.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/optimizer/apply.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/apply.rkt)

  * Line 2, `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/extflonum.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/extflonum.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/optimizer/utils.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/utils.rkt)

  * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.
  * Line 53, `let-to-define`: Internal definitions are recommended instead of `let` expressions, to reduce nesting.

Applied 1 fix to [`typed-racket-lib/typed-racket/optimizer/string.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/string.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/optimizer/unboxed-let.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/optimizer/unboxed-let.rkt)

  * Line 3, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.

## Summary

Fixed 28 issues in 20 files.

  * Fixed 20 occurrences of `tidy-require`
  * Fixed 4 occurrences of `let-to-define`
  * Fixed 1 occurrence of `datum->syntax-migration`
  * Fixed 1 occurrence of `or-in-for/and-to-filter-clause`
  * Fixed 1 occurrence of `if-let-to-cond`
  * Fixed 1 occurrence of `map-to-for`
(for/list ([irritant (in-list (sort irritants
<
#:key (lambda (x) (or (syntax-position x) 0))))])
(let ([irritant (locate-stx irritant)])
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this become a define?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, it's shadowing the irritant loop variable.

(define new-o
(mark-as-non-float (quasisyntax/loc this-syntax
(#,op #,(or o-nf o) #,(or c1-nf c1)))))
(if (stx-null? (stx-cdr cs)) new-o (loop new-o (stx-cdr cs)))]
Copy link
Contributor

@sorawee sorawee Oct 7, 2024

Choose a reason for hiding this comment

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

This should not be collapsed to one line with the fmt PR that @9999years is proposing.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

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

@samth samth merged commit 387eb47 into master Oct 9, 2024
5 checks passed
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.

3 participants