-
-
Notifications
You must be signed in to change notification settings - Fork 104
[DO NOT MERGE]: Add some code for Resyntax to analyze #1277
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
Conversation
This is just to test the Resyntax integration.
6f31011 to
c5601c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resyntax analyzed 1 file in this pull request and has added suggestions.
| (define (distance x1 y1 x2 y2) | ||
| (let ([dx (- x1 x2)] | ||
| [dy (- y1 y2)]) | ||
| (sqrt (+ (* dx dx) (* dy dy))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
| (define (distance x1 y1 x2 y2) | |
| (let ([dx (- x1 x2)] | |
| [dy (- y1 y2)]) | |
| (sqrt (+ (* dx dx) (* dy dy))))) | |
| (define (distance x1 y1 x2 y2) | |
| (define dx (- x1 x2)) | |
| (define dy (- y1 y2)) | |
| (sqrt (+ (* dx dx) (* dy dy)))) |
Debugging details
Textual replacement
(line-replacement
#:new-lines
'#("(define (distance x1 y1 x2 y2)"
" (define dx (- x1 x2))"
" (define dy (- y1 y2))"
" (sqrt (+ (* dx dx) (* dy dy))))")
#:original-lines
'#("(define (distance x1 y1 x2 y2)"
" (let ([dx (- x1 x2)]"
" [dy (- y1 y2)])"
" (sqrt (+ (* dx dx) (* dy dy)))))")
#:start-line 4)Syntactic replacement
(syntax-replacement
#:new-syntax
#<syntax:/home/runner/.local/share/racket/snapshot/pkgs/resyntax/default-recommendations/let-binding-suggestions.rkt:44:3 (define (distance x1 y1 x2 y2) NEWLINE (define dx (- x1 x2)) NEWLINE (define dy (- y1 y2)) NEWLINE (sqrt (+ (* dx dx) (* dy dy))))>
#:original-syntax
#<syntax:typed-racket-lib/typed-racket/private/refactorable-code-example.rkt:4:0 (define (distance x1 y1 x2 y2) (let ((dx (- x1 x2)) (dy (- y1 y2))) (sqrt (+ (* dx dx) (* dy dy)))))>)|
It finally worked! Closing this now. |
This sets up Resyntax analysis on pull requests to this repo. Resyntax will analyze changed files and submit a review of the pull request containing its suggested changes. See [here](racket/typed-racket#1277) for an example. The workflows are a copy of the workflows I made for Typed Racket. In the future we can make these workflows reusable so they don't have to be copied into every repository, but one step at a time.
This sets up Resyntax analysis on pull requests to this repo. Resyntax will analyze changed files and submit a review of the pull request containing its suggested changes. See [here](racket/typed-racket#1277) for an example. The workflows are a copy of the workflows I made for Typed Racket. In the future we can make these workflows reusable so they don't have to be copied into every repository, but one step at a time.
This sets up Resyntax analysis on pull requests to this repo. Resyntax will analyze changed files and submit a review of the pull request containing its suggested changes. See [here](racket/typed-racket#1277) for an example. The workflows are a copy of the workflows I made for Typed Racket. In the future we can make these workflows reusable so they don't have to be copied into every repository, but one step at a time.
This is just to test the Resyntax integration.