Coder Social home page Coder Social logo

Comment formatting about cljstyle HOT 1 CLOSED

greglook avatar greglook commented on July 28, 2024
Comment formatting

from cljstyle.

Comments (1)

sogaiu avatar sogaiu commented on July 28, 2024

I don't know if this counts as comment formatting, but I end up with things that look like this:

(clojure.test/deftest test-at-line-425
  (clojure.test/is (= true (discard-with-form?
                             '(:discard
                                (:whitespace " ")
                                (:map
                                  (:keyword ":a") (:whitespace " ")
                                  (:number "1")))))))
;; XXX: iiuc, discard forms in parcera can have up to 2
;;      elements in them.  if there are two elements,
;;      the first is whitespace.
;;
;;      if the understanding above is false, the following
;;      code should be modified.
(defn undiscard
  [ast]
  (when (discard-with-form? ast)
    (->> (rest ast)
         (drop-while whitespace?)
         first)))

I'd like for there to be a line between the last line of the first deftest form and the first line of the comment. I tried a variety of configuration settings without much success.

FWIW, the following is what I had in .cljstyle to produce the output above:

{:indentation? true
 :insert-missing-whitespace? true
 :insert-padding-lines? true
 :line-break-functions? true
 :max-consecutive-blank-lines 0
 :padding-lines 1
 :remove-consecutive-blank-lines? true
 :remove-surrounding-whitespace? true
 :remove-trailing-whitespace? true
 :require-eof-newline? true}

The settings above were tuned a bit to try to have a single line between top-level forms -- and that seemed to be working.

Any ideas?

from cljstyle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.