Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Prevent clean-ns from putting :as and :refer on their own lines #305

Closed
Assignees
expez
@expez

Description

@expez

This is due the default output fromclojure.pprint/pprint when a vector grows long. It will then put each element on their own line. This looks especially stupid with libspec vectors:

[a.pretty.long.ns.gets.its.own.line.like.it.should:as  but-then-the-alias-comes-way-down-here]

A better formatting would be:

[a.pretty.long.ns.gets.its.own.line.like.it.should:as the-alias-comes-on-this-line-instead]

I want to give:refer the same treatment.

[a.pretty.long.ns.gets.its.own.line.like.it.should:refer [this that]

becomes:

[a.pretty.long.ns.gets.its.own.line.like.it.should:refer [this that]

This will, however, cause a bit of a regression if you have a ton of referred symbols:

(require '[a.pretty.long.ns.gets.its.own.line.like.it.should:refer   [this    that    the    other    more    moar    andfinally    the    problem    on    comes    on    line-wrap]])

becomes:

(require '[a.pretty.long.ns.gets.its.own.line.like.it.should:refer [this                   that                   the                   other                   more                   moar                   andfinally                   the                   problem                   on                   comes                   on                   line-wrap]])

I think these both look super bad. This behavior will privilege short:refer clauses, but I think that's fine. Having tons of referred symbols is an anti-pattern anyway, so we should nudge people toward not doing that.

If someone does this consistently we can always take another PR improving this edge-case further.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp