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

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

Automated Resyntax fixes #716

wants to merge 6 commits into from

Conversation

resyntax-ci[bot]
Copy link
Contributor

@resyntax-ci resyntax-ci bot commented Feb 2, 2025

Resyntax fixed 20 issues in 3 files.

  • Fixed 11 occurrences of let-to-define
  • Fixed 3 occurrences of nested-for-to-for*
  • Fixed 2 occurrences of if-else-false-to-and
  • Fixed 2 occurrences of when-expression-in-for-loop-to-when-keyword
  • Fixed 1 occurrence of hash-set!-ref-to-hash-update!
  • Fixed 1 occurrence of zero-comparison-to-positive?

resyntax-ci bot added 6 commits February 2, 2025 00:13
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
This expression can be replaced with a simpler, equivalent `hash-update!` expression.
These nested `for` loops can be replaced by a single `for*` loop.
This `if` expression can be refactored to an equivalent expression using `and`.
Use the `#:when` keyword instead of `when` to reduce loop body indentation.
This expression is equivalent to calling the `positive?` predicate.
(let* ([pos-left (- (syntax-position stx) 1)]
[pos-right (+ pos-left (syntax-span stx))])
(send defs-text
syncheck:add-jump-to-definition/phase-level+space
Copy link
Member

Choose a reason for hiding this comment

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

I think this isn't how we want to format send calls. I would prefer the method name be as it was before, on the same line as the send.

;; assume this is a binder, show uses
#;(when (and color? (zero? start))
(color-unused-binder (list-ref key 0) (list-ref key 1) (list-ref key 2)))
[(zero? end) (show-starts)]
Copy link
Member

Choose a reason for hiding this comment

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

Something went wrong here. The code should behave the same but the comment went into the wrong place.

(color-unused-binder (list-ref key 0) (list-ref key 1) (list-ref key 2)))
[(zero? end) (show-starts)]
;; assume this is a use, show bindings (usually just one, so do nothing)
[(zero? start) (show-ends)]
Copy link
Member

Choose a reason for hiding this comment

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

same here, although this one is less wrong, I'd say.

@rfindler
Copy link
Member

rfindler commented Feb 2, 2025

Aside from the comments, this looks good to me.

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.

1 participant