Git Product home page Git Product logo

Comments (6)

reinux avatar reinux commented on May 20, 2024 1

Stuff like this:

let arrange itemWidth (getSize: 'i -> int * int) (canvasWidth, canvasHeight) (items: 'i list) : Rect list =
  let rec loop (left, top) bottom items rects =
    match items with
    | x :: xs ->
      let width, height = getSize x
      let ratio = (float width / float height)
      let width, height = itemWidth, int (float height / ratio)
                          // inserted empty line
      if top + height > canvasHeight then
        rects

      elif left + width > canvasWidth then
        if bottom + height > canvasHeight then
          rects
        else
          let rect =
            { left = 0
              top = bottom
              width = width
              height = height }
                          // inserted empty line
          loop (0, bottom) (bottom + height) xs (rect :: rects)

      else
        let rect =
          { left = left
            top = top
            width = width
            height = height }
                          // inserted empty line
        loop (left + rect.left, top) (max bottom (top + rect.height)) xs (rect :: rects)
    | [] -> rects

  loop (0, 0) 0 items [] |> List.rev

I have my code arranged into paragraphs that indicate conceptually related code, but Fantomas places blank lines between let bindings and return expressions, which makes the deliberate paragraph groupings harder to spot.

Sorry, I didn't mean for this to be a Fantomas question on the Giraffe repo, but I was just thinking that it would be nice to configure that (if possible) if Giraffe gets the Fantomas treatment.

from giraffe.

TheAngryByrd avatar TheAngryByrd commented on May 20, 2024 1

Here are my personal tastes for Fantomas with editorconfig

from giraffe.

reinux avatar reinux commented on May 20, 2024

Is there a way to have it respect blank lines? I tend not to use Fantomas because it didn't respect paragraph breaks last time I checked.

from giraffe.

64J0 avatar 64J0 commented on May 20, 2024

I did not get your point @reinux. You mention in comments, right?

In my experience it does not touch comments, but just to make sure, can you please provide an example for what you have in mind?

Other than that, considering that this has the potential to influence all the codebase, I think it's worth adding it only to the samples along with the tests first.

from giraffe.

64J0 avatar 64J0 commented on May 20, 2024

Got it now, thanks for the clarification. I'm not sure if it's possible but I'll take a look.

from giraffe.

64J0 avatar 64J0 commented on May 20, 2024

We can configure Fantomas using some .editorconfig commands: https://fsprojects.github.io/fantomas/docs/end-users/Configuration.html.

from giraffe.

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.