Comments (1)
This might be better split into two issues.
The first, removing parentheses around functions with one arity, seems pretty specific to functions alone. We could add that in as its own rule, and it would likely only be a few lines of code.
The second issue, fixing newlines, seems a more general issue, like indentation. I've been thinking about specifying rules to denote valid points for newlines. For instance:
;; valid
(if x y z)
;; valid
(if x
y
z)
;; invalid
(if x y
z)
I'm not decided on the syntax for specifying the rules yet. Perhaps something like:
[[if _ _ _]
[if _ \n _ \n _]]
For when
and similar, we also need to have some repetition:
[[when _ _ *]
[when _ \n (_ \n) *]]
And for defn
, some sort of predicate/type match:
[[defn _ :vector \n (_ \n) *]
[defn _ \n :string \n (_ \n) *]]
from cljfmt.
Related Issues (20)
- Format clojure file with shebang HOT 6
- Exception when using 0.10.x series as a Leiningen plugin HOT 3
- lein-cljfmt is broken
- Custom Output Pattern HOT 2
- Incorrect cljfmt.config/load-config defaults merge HOT 5
- latest 0.11.0 linux static binary is broken HOT 4
- Options don't merge correctly (version 11) HOT 5
- Change 11 to be non breaking HOT 13
- Format if to one line or 3 HOT 1
- `reformat-string` doesn't honor `:legacy/merge-indents? true` HOT 8
- Add node.js support to `cljfmt.config`
- Homebrew HOT 10
- Make one space list indentation configurable
- Add option to exclude (comment) blocks from formatting HOT 3
- Un-nest namespace functionality HOT 1
- Support multiple config.edn files HOT 3
- Consider adding support for pre-commit
- Identation off for protocol with metadata
- `extend-protocol`/`defprotocol`/etc. incorrectly uses indentation specs for method names
- Indentation rules break if namespace form in `:require` has metadata on it HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cljfmt.