Skip to content

Require tidying breaks on nested import of require transformer #383

@jackfirth

Description

@jackfirth

As discussed here, this code:

(require "my-transformer.rkt"
         (my-transformer-in))

Is currently refactored by Resyntax into this:

(require (my-transformer-in)
         "my-transformer.rkt")

Assuming my-transformer-in came from my-transformer.rkt, this breaks the code. Require transformers can only be used after they're imported.

Resyntax shouldn't bother trying to tidy requires when unknown require transformers are used. Doing something smarter is technically possible, but requires a lot of effort. Ideally the code would be refactored to have a completely separate (require "my-transformer.rkt") form that occurs before the module's main require form, which is the simplest way to avoid this problem in practice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexisting lintIssues or pull requests relating to existing lints

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions