Skip to content

Automated Resyntax fixes #681

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
Sep 20, 2024
Merged

Automated Resyntax fixes #681

merged 1 commit into from
Sep 20, 2024

Conversation

github-actions[bot]
Copy link
Contributor

This is an automated change generated by Resyntax.

Pass 1

Applied 1 fix to drracket-test/tests/drracket/repl-test-raw.rkt

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

Applied 4 fixes to drracket-test/tests/drracket/populate-compiled.rkt

  • Line 2, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 12, make-temporary-directory-migration: Use make-temporary-directory to make directories instead of make-temporary-file.
  • Line 82, tidy-require: Keep imports in require sorted and grouped by phase, with collections before files.
  • Line 97, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.

Applied 3 fixes to drracket/drracket/private/honu-logo.rkt

  • Line 12, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.
  • Line 18, define-lambda-to-define: The define form supports a shorthand for defining functions (including function-returning functions).
  • Line 131, let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.

Applied 1 fix to drracket-test/tests/drracket/module-browser.rkt

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

Applied 1 fix to drracket/drracket/syncheck-drracket-button.rkt

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

Summary

Fixed 10 issues in 5 files.

  • Fixed 5 occurrences of tidy-require
  • Fixed 3 occurrences of let-to-define
  • Fixed 1 occurrence of make-temporary-directory-migration
  • Fixed 1 occurrence of define-lambda-to-define

This is an automated change generated by Resyntax.

#### Pass 1

Applied 1 fix to [`drracket-test/tests/drracket/repl-test-raw.rkt`](../blob/HEAD/drracket-test/tests/drracket/repl-test-raw.rkt)

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

Applied 4 fixes to [`drracket-test/tests/drracket/populate-compiled.rkt`](../blob/HEAD/drracket-test/tests/drracket/populate-compiled.rkt)

  * Line 2, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.
  * Line 12, `make-temporary-directory-migration`: Use `make-temporary-directory` to make directories instead of `make-temporary-file`.
  * Line 82, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files.
  * Line 97, `let-to-define`: Internal definitions are recommended instead of `let` expressions, to reduce nesting.

Applied 3 fixes to [`drracket/drracket/private/honu-logo.rkt`](../blob/HEAD/drracket/drracket/private/honu-logo.rkt)

  * Line 12, `let-to-define`: Internal definitions are recommended instead of `let` expressions, to reduce nesting.
  * Line 18, `define-lambda-to-define`: The `define` form supports a shorthand for defining functions (including function-returning functions).
  * Line 131, `let-to-define`: Internal definitions are recommended instead of `let` expressions, to reduce nesting.

Applied 1 fix to [`drracket-test/tests/drracket/module-browser.rkt`](../blob/HEAD/drracket-test/tests/drracket/module-browser.rkt)

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

Applied 1 fix to [`drracket/drracket/syncheck-drracket-button.rkt`](../blob/HEAD/drracket/drracket/syncheck-drracket-button.rkt)

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

## Summary

Fixed 10 issues in 5 files.

  * Fixed 5 occurrences of `tidy-require`
  * Fixed 3 occurrences of `let-to-define`
  * Fixed 1 occurrence of `make-temporary-directory-migration`
  * Fixed 1 occurrence of `define-lambda-to-define`
@Metaxal
Copy link
Contributor

Metaxal commented Sep 18, 2024

I think the order of the imports can matter also, if there is some overlap between imported names.

I noticed this issue once after moving the define2 import (which redefines define) above another import that also redefined define.

@jackfirth
Copy link
Collaborator

@Metaxal I was under the impression that such a scenario is a compile error unless the two exported identifiers are free-identifier=? (possibly because one is actually a reexport of the other).

@Metaxal
Copy link
Contributor

Metaxal commented Sep 18, 2024

Hm 🤔 A quick test right now tells me that you're right (which is a relief actually), but I do remember having an issue of the sort, and since then I'm always placing define2 last.

If I can reproduce the issue I'll try to remember to send it your way. In the meantime, just forget what I said I guess.

@rfindler
Copy link
Member

The rest of the changes look good to me, assuming the guesses I wrote about were correct.

@greghendershott
Copy link
Contributor

I think the order of the imports can matter also, if there is some overlap between imported names.

Although it's not about overlapping names, racket/require is an example that needs to be required before using any of the extra require sub-forms it supplies, like multi-in.

During a phase where I was infatuated with multi-in, I added a special case for this greghendershott/racket-mode#355. Not sure whether I should feel proud or ashamed about that...

@jackfirth jackfirth merged commit 34bf9de into master Sep 20, 2024
@shhyou shhyou deleted the autofix-57-1 branch January 12, 2025 23:12
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.

8 participants