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 #1412

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Automated Resyntax fixes #1412

wants to merge 13 commits into from

Conversation

resyntax-ci[bot]
Copy link
Contributor

@resyntax-ci resyntax-ci bot commented Nov 18, 2024

WARNING: Missing test for base type 'Positive-Single-Flonum'
WARNING: Missing test for base type '∪'
WARNING: Missing test for base type 'Single-Flonum'
WARNING: Missing test for base type 'Intersection'
WARNING: Missing test for base type 'Inexact-Imaginary'
WARNING: Missing test for base type 'Single-Flonum-Complex'
WARNING: Missing test for base type 'Union'
WARNING: Missing test for base type 'Single-Flonum-Zero'
WARNING: Missing test for base type 'ExtFlVector'
WARNING: Missing test for base type '∩'
WARNING: Missing test for base type 'ExtFlonum-Positive-Zero'
WARNING: Missing test for base type 'Nonpositive-ExtFlonum'
WARNING: Missing test for base type 'Place'
WARNING: Missing test for base type 'U'
WARNING: Missing test for base type 'ExtFlonum-Zero'
WARNING: Missing test for base type 'Internal-Definition-Context'
WARNING: Missing test for base type 'Read-Table'
WARNING: Missing test for base type 'Un'
WARNING: Missing test for base type 'Negative-Single-Flonum'
WARNING: Missing test for base type 'Unquoted-Printing-String'
WARNING: Missing test for base type 'Negative-ExtFlonum'
WARNING: Missing test for base type 'Single-Flonum-Negative-Zero'
WARNING: Missing test for base type 'Single-Flonum-Positive-Zero'
WARNING: Missing test for base type 'ExtFlonum'
WARNING: Missing test for base type 'Nonnegative-Single-Flonum'
WARNING: Missing test for base type 'ExtFlonum-Nan'
WARNING: Missing test for base type 'ExtFlonum-Negative-Zero'
WARNING: Missing test for base type 'Single-Flonum-Nan'
WARNING: Missing test for base type 'Positive-ExtFlonum'
WARNING: Missing test for base type 'Nonnegative-ExtFlonum'
WARNING: Missing test for base type 'Nonpositive-Single-Flonum'
This is an automated change generated by Resyntax.

Pass 1

Applied 3 fixes to typed-racket-lib/typed-racket/types/signatures.rkt

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

Applied 6 fixes to typed-racket-lib/typed-racket/types/base-abbrev.rkt

  • Line 105, define-syntax-syntax-rules-to-define-syntax-rule: This define-syntax macro can be replaced with a simpler, equivalent define-syntax-rule macro.
  • Line 109, define-syntax-syntax-rules-to-define-syntax-rule: This define-syntax macro can be replaced with a simpler, equivalent define-syntax-rule macro.
  • Line 496, define-syntax-syntax-rules-to-define-syntax-rule: This define-syntax macro can be replaced with a simpler, equivalent define-syntax-rule macro.
  • Line 502, define-syntax-syntax-rules-to-define-syntax-rule: This define-syntax macro can be replaced with a simpler, equivalent define-syntax-rule macro.
  • Line 509, define-syntax-syntax-rules-to-define-syntax-rule: This define-syntax macro can be replaced with a simpler, equivalent define-syntax-rule macro.
  • Line 516, define-syntax-syntax-rules-to-define-syntax-rule: This define-syntax macro can be replaced with a simpler, equivalent define-syntax-rule macro.

Applied 1 fix to typed-racket-test/succeed/pr575-variation-3.rkt

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

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

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 51, inverted-when: This negated when expression can be replaced by an unless expression.

Applied 1 fix to typed-racket-test/succeed/tr-evt.rkt

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

Applied 1 fix to typed-racket-test/succeed/pr14829.rkt

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

Applied 2 fixes to typed-racket-lib/typed-racket/types/generalize.rkt

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

Applied 1 fix to typed-racket-lib/typed/private/no-check-helper.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/succeed/opaque-object-name.rkt

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

Applied 3 fixes to typed-racket-lib/typed-racket/types/utils.rkt

  • Line 19, define-lambda-to-define: The define form supports a shorthand for defining functions.
  • Line 60, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 79, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.

Applied 1 fix to typed-racket-test/succeed/type-printer-single-level.rkt

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

Applied 1 fix to typed-racket-lib/typed-racket/types/overlap.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/types/subtype.rkt

  • Line 536, apply-flattening: The apply function accepts single arguments in addition to a trailing list argument.
  • Line 661, if-else-false-to-and: This if expression can be refactored to an equivalent expression using and.
  • Line 793, single-clause-match-to-match-define: This match expression can be simplified using match-define.

Applied 1 fix to typed-racket-test/succeed/opaque-object-stronger.rkt

  • Line 143, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.

Applied 1 fix to typed-racket-test/succeed/vector-contract.rkt

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

Applied 2 fixes to typed-racket-lib/typed-racket/tc-setup.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 39, if-begin-to-cond: Using cond instead of if here makes begin unnecessary

Applied 1 fix to typed-racket-test/succeed/hash-contract.rkt

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

Applied 4 fixes to typed-racket-lib/typed-racket/typed-reader.rkt

  • Line 11, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 25, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 35, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 68, case-lambda-with-single-case-to-lambda: This case-lambda form only has one case. Use a regular lambda instead.

Applied 2 fixes to typed-racket-lib/typed/private/rewriter.rkt

  • Line 2, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 10, syntax-disarm-migration: The syntax-disarm function is a legacy function that does nothing.

Applied 1 fix to typed-racket-test/succeed/check-env-lang-based-env.rkt

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

Pass 2

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

  • Line 14, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 27, cond-let-to-cond-define: Internal definitions are recommended instead of let expressions, to reduce nesting.

Summary

Fixed 40 issues in 20 files.

  • Fixed 15 occurrences of tidy-require
  • Fixed 10 occurrences of let-to-define
  • Fixed 6 occurrences of define-syntax-syntax-rules-to-define-syntax-rule
  • Fixed 1 occurrence of single-clause-match-to-match-define
  • Fixed 1 occurrence of case-lambda-with-single-case-to-lambda
  • Fixed 1 occurrence of inverted-when
  • Fixed 1 occurrence of if-begin-to-cond
  • Fixed 1 occurrence of apply-flattening
  • Fixed 1 occurrence of define-lambda-to-define
  • Fixed 1 occurrence of cond-let-to-cond-define
  • Fixed 1 occurrence of syntax-disarm-migration
  • Fixed 1 occurrence of if-else-false-to-and

Keep imports in `require` sorted and grouped by phase, with collections before files.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
This `define-syntax` macro can be replaced with a simpler, equivalent `define-syntax-rule` macro.
This negated `when` expression can be replaced by an `unless` expression.
The `define` form supports a shorthand for defining functions.
The `apply` function accepts single arguments in addition to a trailing list argument.
This `if` expression can be refactored to an equivalent expression using `and`.
This `match` expression can be simplified using `match-define`.
Using `cond` instead of `if` here makes `begin` unnecessary
This `case-lambda` form only has one case. Use a regular lambda instead.
The `syntax-disarm` function is a legacy function that does nothing.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
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.

0 participants