Skip to content

Semantics of :standard-clj/ignore #199

@yuhan0

Description

@yuhan0

The naming of :standard-clj/ignore feels somewhat off - someone unfamiliar with the language ecosystem could misinterpret it as referring to something much broader like official language features / standards, rather than being the name of a formatting tool.

At the same time it suggests too limited a scope – if one marks a form or file with :standard-clj/ignore is that really a tool-specific directive? I imagine the intent is not for a specific formatter to 'ignore' the expression and its formatting, but to express something like "We have carefully formatted this in a way that conveys something useful / important, please don't touch it!"

Imagining that other formatters implemented a similar feature, it would seem silly to have to say

#_:standard-clj/ignore
#_:cljfmt/ignore
#_:zprint/ignore
(def something
  [ with
  , { non
    , standard
    }
  , formatting
  ])

I think a more descriptive and tool-agnostic keyword to convey the intent would be something like :style/preserve or :style/keep-formatting.
There is some precedent for the style namespace in Cider's use of the :style/indent metadata key, intended for use across different tools.

(I wasn't previously aware of this feature, apologies for bringing it up only now - but hopefully any proposed change would be simply additive and non-breaking)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions