Comments (6)
There isn't really a foolproof way to tell keyword arguments from positional arguments. If you've got a sensible heuristic, I'd consider a very simple patch via PR. Absent a PR, I'm going to close this ticket for reasons discussed below.
Since this (and similar comments) have come up before, I'm going to take this opportunity to put some of my design thoughts about Fipp in to writing: First and foremost, Fipp is a pretty printer construction kit. It comes with two pre-constructed printers: One for Edn and one for Clojure Code.
My Edn printer is intended to be fast. Fast enough to use for pretty-printing large data files. If you want truly pretty data, you can use the Fipp-based https://github.com/greglook/puget/ printer, which trades some speed for features (like sorting keys in maps and colorization).
@mkremins' contributed Clojure code printer is intended to be simple. It's never going to support deep analysis, rich customization, or stuff like that. It's not a code reformatter. The primary use-case is for debugging macro-expansions. In that context, failure to meet community accepted style guidelines is perfectly acceptable and entirely expected. If somebody wanted to follow in Puget's footsteps and use Fipp to create a richly featured code-printer (maybe utilizing tools.analyzer), I'd be happy to support and promote their efforts.
That said, Fipp will always strive to provide primitives that can preserve the linear time and bounded space guarantees. That said, the code which produces the "pretty document" fed to the printing engine can trivially utilize non-linear time or unbounded space (Pudget does when sorting). I'd expect that a fully featured source beautifier may also need richer primitives to execute inside the printing engine. Such primitives would need to be considered on a case-by-case basis and any potentially-slow primitives would need a very strong justification.
from fipp.
Fair enough, I had the impression Fipp was supposed to replace the source code (as in 'program') capabilities of Clojure's own pprint. My bad!
from fipp.
Fipp does in fact have most of the functionality of Clojure's own pprint, which largely targets the same use case (debugging; not reformatting).
from fipp.
@brandonbloom thanks for linking to your discussing here from the fipp docs. I understand fipp is targeting debugging use cases and not code formatting/refactoring. Can you point to any projects that do build off fipp (like puget) to target code formatting? Perhaps there are none, either way Fipp seems like it would be a good building block towards that goal
from fipp.
I'm sure some exist, but I do not make use of any of them, so I can't point you in the right direction. Sorry.
from fipp.
@brandonbloom fair enough thnx!
from fipp.
Related Issues (20)
- question - how to print edn with two space indentation? HOT 1
- Add a version of fipp that prints to string HOT 11
- Just a small warning in CLJS (undeclared var `fipp.edn/*file*`) HOT 1
- Cannot load fipp in Java 9 using bootclasspath HOT 10
- Optional println? HOT 1
- Make usage of commas optional HOT 3
- :pass rendered before indentation HOT 4
- clojurescript tests failing HOT 2
- consider automating tests on circleci HOT 3
- print-table of nested map HOT 1
- Use of undeclared Var clojure.core.rrb-vector.rrbt/Transient HOT 3
- java.sql.Timestamp not guaranteed to exist HOT 9
- BigDecimal Handling HOT 10
- Escaping of newlines in strings HOT 2
- Incompatible with Java 11 due to org.clojure/core.rrb-vector dependency HOT 1
- a strange case in generating regex with slashes, related to ClojureScript HOT 5
- print unreadable symbol utilizing #=(symbol ...) for *read-eval* HOT 1
- Babashka compatibility HOT 19
- How to specify fixed width floats in specific tagged-literals for output purposes HOT 2
- ClojureScript: fipp interacts badly with console.log as default print strategy HOT 6
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 fipp.