Skip to content

Only use #:when and #:unless with multi-body loops #765

@jackfirth

Description

@jackfirth

Often, the unless-expression-in-for-loop-to-unless-keyword rule (and its corresponding when-based rule) rewrites this:

(for ([v (in-list vs)])
  (unless (good? v)
    (raise-arguments-error ...)))

to this:

(for ([v (in-list vs)]
      #:unless (good? v))
  (raise-arguments-error ...))

I don't think that's an improvement. I think these rules should only remove a when or unless from a loop if it has more than one body form inside it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    autopilot-candidateThe Copilot Agent should attempt this during a scheduled Autopilot runexisting 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