typed-racket icon indicating copy to clipboard operation
typed-racket copied to clipboard

Automated Resyntax fixes

Open resyntax-ci[bot] opened this issue 1 year ago • 0 comments

This is an automated change generated by Resyntax.

Pass 1

Applied 1 fix to typed-racket-lib/typed-racket/typecheck/possible-domains.rkt

  • Line 58, and-match-to-match: This and expression can be turned into a clause of the inner match expression, reducing nesting.

Applied 2 fixes to typed-racket-lib/typed-racket/typecheck/integer-refinements.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 74, define-lambda-to-define: The define form supports a shorthand for defining functions.

Applied 3 fixes to typed-racket-lib/typed-racket/typecheck/toplevel-trampoline.rkt

  • Line 11, 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.
  • Line 64, if-begin-to-cond: Using cond instead of if here makes begin unnecessary

Applied 1 fix to typed-racket-lib/typed-racket/private/type-annotation.rkt

  • 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/private/user-defined-type-constr.rkt

  • Line 2, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 32, single-clause-match-to-match-define: This match expression can be simplified using match-define.

Applied 1 fix to typed-racket-lib/typed-racket/typecheck/check-unit-unit.rkt

  • Line 178, define-lambda-to-define: The define form supports a shorthand for defining functions.

Applied 15 fixes to typed-racket-lib/typed-racket/private/type-contract.rkt

  • Line 242, if-begin-to-cond: Using cond instead of if here makes begin unnecessary
  • Line 389, unused-definition: This definition is not used.
  • Line 557, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 838, always-throwing-cond-to-when: Using when and unless is simpler than a conditional with an always-throwing branch.
  • Line 1139, unused-definition: This definition is not used.
  • Line 1167, single-clause-match-to-match-define: This match expression can be simplified using match-define.
  • Line 1270, zero-comparison-lambda-to-positive?: This lambda function is equivalent to the built-in positive? predicate.
  • Line 1290, map-to-for: This map operation can be replaced with a for/list loop.
  • Line 1295, single-clause-match-to-match-define: This match expression can be simplified using match-define.
  • Line 1324, unused-definition: This definition is not used.
  • Line 1549, define-lambda-to-define: The define form supports a shorthand for defining functions.
  • Line 1550, define-lambda-to-define: The define form supports a shorthand for defining functions.
  • Line 1551, define-lambda-to-define: The define form supports a shorthand for defining functions.
  • Line 1552, define-lambda-to-define: The define form supports a shorthand for defining functions.
  • Line 1553, define-lambda-to-define: The define form supports a shorthand for defining functions.

Applied 8 fixes to typed-racket-lib/typed-racket/private/shallow-rewrite.rkt

  • Line 225, if-let-to-cond: cond with internal definitions is preferred over if with let, to reduce nesting
  • Line 275, define-let-to-double-define: This let expression can be pulled up into a define expression.
  • Line 287, if-let-to-cond: cond with internal definitions is preferred over if with let, to reduce nesting
  • Line 418, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 428, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 452, if-let-to-cond: cond with internal definitions is preferred over if with let, to reduce nesting
  • Line 632, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 717, unused-definition: This definition is not used.

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

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

Applied 2 fixes to typed-racket-lib/typed-racket/typecheck/check-below.rkt

  • Line 3, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 86, unused-definition: This definition is not used.

Applied 3 fixes to typed-racket-lib/typed-racket/typecheck/tc-expr-unit.rkt

  • Line 96, single-clause-match-to-match-define: This match expression can be simplified using match-define.
  • Line 146, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 197, format-identity: This use of format does nothing.

Applied 1 fix to typed-racket-lib/typed-racket/private/syntax-properties.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/private/parse-classes.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/private/parse-type.rkt

  • Line 186, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 1509, for/fold-with-conditional-body-to-unless-keyword: This for/fold loop can be simplified by using the #:unless keyword.
  • Line 1658, inline-unnecessary-define: This variable is returned immediately and can be inlined.

Summary

Fixed 45 issues in 14 files.

  • Fixed 8 occurrences of tidy-require
  • Fixed 7 occurrences of let-to-define
  • Fixed 7 occurrences of define-lambda-to-define
  • Fixed 5 occurrences of unused-definition
  • Fixed 4 occurrences of single-clause-match-to-match-define
  • Fixed 3 occurrences of if-let-to-cond
  • Fixed 2 occurrences of if-begin-to-cond
  • Fixed 1 occurrence of and-match-to-match
  • Fixed 1 occurrence of format-identity
  • Fixed 1 occurrence of for/fold-with-conditional-body-to-unless-keyword
  • Fixed 1 occurrence of inline-unnecessary-define
  • Fixed 1 occurrence of always-throwing-cond-to-when
  • Fixed 1 occurrence of zero-comparison-lambda-to-positive?
  • Fixed 1 occurrence of map-to-for
  • Fixed 1 occurrence of define-let-to-double-define
  • Fixed 1 occurrence of inverted-unless

resyntax-ci[bot] avatar Oct 18 '24 00:10 resyntax-ci[bot]