这是indexloc提供的服务,不要输入任何密码
Skip to content

Automated Resyntax fixes #1398

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

Merged
merged 1 commit into from
Oct 5, 2024
Merged

Automated Resyntax fixes #1398

merged 1 commit into from
Oct 5, 2024

Conversation

resyntax-ci[bot]
Copy link
Contributor

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

This is an automated change generated by Resyntax.

Pass 1

Applied 2 fixes to typed-racket-lib/typed-racket/env/type-alias-helper.rkt

  • Line 5, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 307, inline-unnecessary-define: This variable is returned immediately and can be inlined.

Applied 1 fix to typed-racket-lib/typed-racket/env/signature-env.rkt

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

Applied 5 fixes to typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt

  • Line 7, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 32, inline-unnecessary-define: This variable is returned immediately and can be inlined.
  • Line 52, always-throwing-if-to-when: Using when and unless is simpler than a conditional with an always-throwing branch.
  • Line 61, cond-let-to-cond-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 82, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.

Pass 2

Applied 1 fix to typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt

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

Pass 3

Applied 1 fix to typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt

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

Pass 4

Applied 1 fix to typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt

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

Pass 5

Applied 1 fix to typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt

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

Pass 6

Applied 1 fix to typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt

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

Pass 7

Applied 1 fix to typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt

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

Pass 8

Applied 1 fix to typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt

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

Pass 9

Applied 1 fix to typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt

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

Pass 10

Applied 1 fix to typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt

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

Summary

Fixed 17 issues in 3 files.

  • Fixed 12 occurrences of tidy-require
  • Fixed 2 occurrences of inline-unnecessary-define
  • Fixed 1 occurrence of always-throwing-if-to-when
  • Fixed 1 occurrence of cond-let-to-cond-define
  • Fixed 1 occurrence of let-to-define

This is an automated change generated by Resyntax.

#### Pass 1

Applied 2 fixes to [`typed-racket-lib/typed-racket/env/type-alias-helper.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/env/type-alias-helper.rkt)

  * Line 5, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.
  * Line 307, `inline-unnecessary-define`: This variable is returned immediately and can be inlined.

Applied 1 fix to [`typed-racket-lib/typed-racket/env/signature-env.rkt`](../blob/HEAD/typed-racket-lib/typed-racket/env/signature-env.rkt)

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

Applied 5 fixes to [`typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt`](../blob/HEAD/typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt)

  * Line 7, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.
  * Line 32, `inline-unnecessary-define`: This variable is returned immediately and can be inlined.
  * Line 52, `always-throwing-if-to-when`: Using `when` and `unless` is simpler than a conditional with an always-throwing branch.
  * Line 61, `cond-let-to-cond-define`: Internal definitions are recommended instead of `let` expressions, to reduce nesting.
  * Line 82, `let-to-define`: Internal definitions are recommended instead of `let` expressions, to reduce nesting.

#### Pass 2

Applied 1 fix to [`typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt`](../blob/HEAD/typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt)

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

#### Pass 3

Applied 1 fix to [`typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt`](../blob/HEAD/typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt)

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

#### Pass 4

Applied 1 fix to [`typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt`](../blob/HEAD/typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt)

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

#### Pass 5

Applied 1 fix to [`typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt`](../blob/HEAD/typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt)

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

#### Pass 6

Applied 1 fix to [`typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt`](../blob/HEAD/typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt)

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

#### Pass 7

Applied 1 fix to [`typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt`](../blob/HEAD/typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt)

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

#### Pass 8

Applied 1 fix to [`typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt`](../blob/HEAD/typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt)

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

#### Pass 9

Applied 1 fix to [`typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt`](../blob/HEAD/typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt)

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

#### Pass 10

Applied 1 fix to [`typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt`](../blob/HEAD/typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt)

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

## Summary

Fixed 17 issues in 3 files.

  * Fixed 12 occurrences of `tidy-require`
  * Fixed 2 occurrences of `inline-unnecessary-define`
  * Fixed 1 occurrence of `always-throwing-if-to-when`
  * Fixed 1 occurrence of `cond-let-to-cond-define`
  * Fixed 1 occurrence of `let-to-define`
Comment on lines +7 to +14
(require racket/list
racket/pretty
racket/set
rackunit
syntax/parse
(only-in racket/format ~a)
(only-in syntax/modread with-module-reading-parameterization)
"../test-utils.rkt")
Copy link
Contributor

Choose a reason for hiding this comment

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

This require form seemed to trip up Resyntax for some reason. The output looks nice, but Resyntax ran 10 passes and kept repeatedly trying to tidy these requires. Not sure what's up with that.

@samth
Copy link
Member

samth commented Oct 5, 2024

This is good, but I think I'd prefer significantly larger PRs from resyntax rather than doing this a lot of times.

@jackfirth
Copy link
Contributor

Noted, I'll send a PR to bump up the limits.

@jackfirth jackfirth merged commit 2d6b433 into master Oct 5, 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.

2 participants