-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Results from applying fix in v.0.5.0 to Wolframite #102
Comments
Thank you for the report and the kinds words 🤓 I will look into these. |
FYI - this is tracked at Issue #87 |
This is a bug. Tracked at Issue #104
I suspect these are the same bug. Tracked at Issue #103 |
This is a tricky case. I think the best answer is "put it all on one line" (ie: the current behavior). Standard Clojure Style prints I think the simplest behavior is:
I realize that it seems strange that a code formatter would recommend "refactor your code" as a solution, but I think for long In clojure namespace aliases we have the advice of "Use From how to ns there is a recommendation of "Do not |
cljfmt will add line breaks at 80 chars in refer vectors. It doesn't necessarily look great but it works better than lines that are 200 characters long lol. |
Regarding the long require and
and the general advice on refer an use - in general, I agree with the rules. But as is always the case with rules, they are too limited to capture the richness of the world. In this particular case of this special library, what we do makes a very good sense. I wouldn't want to compromise user UX to make a formatter happy. What Noah suggests makes sense to me - if the line is too long, insert a break around e.g. 80. May not be beautiful but it works and is consistent.... |
Here's an example file that uses the "newline at N characters" rule: https://github.com/mtgred/netrunner/blob/master/src/clj/game/cards/agendas.clj Rewriting this to use aliases would make the require block prettier at the expense of the rest of the file. |
One could argue that if a line length limit applies in some places it should perhaps apply everywhere for consistency's sake. |
This is well said and I agree 100%. There will always be special cases and good reasons why someone might want to bypass the formatter for some particular chunk of code or an entire file. v0.8.0 adds support for |
FYI @holyjak - v0.10.0 contains several fixes related to the issues you reported here
|
I just ran This is subjective of course, but these changes look good to me! I think in general they are an improvement to the codebase. Thank you again @holyjak for the initial report 🙏 It was helpful to find some important bugs with the formatter. |
Hello! I very much applaud this work! As asked, I have tried to apply
fix
to our library Wolframite, and here are the results: scicloj/wolframite#134Some very nice changes but also some weird / incorrect / questionable:
:require
vectors are aligned below ther
- as Cursive user I am used to that, but Emacs tends to align below:
. I agree with the choice :-) but want to highlight that this may be a source of disagreementsThe text was updated successfully, but these errors were encountered: