Skip to content

Conversation

@lukasz-golebiewski
Copy link
Member

(Optionally) turns this:

module Herp where

data Foo a = Foo { a :: Int, a2 :: String } | Bar { b :: a } 

into

module Herp where

data Foo a = Foo 
  { a :: Int
  , a2 :: String 
  } 
  | Bar
  { b :: a
  }

Copy link
Member

@jaspervdj jaspervdj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for the contribution!


# Format record definitions
- records:
indent: 4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would move the indent setting to the top-level, just like columns, so that other steps may possibly use this value?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea :-) Done
Thanks for the review!

EncodePanda and others added 28 commits January 18, 2020 20:19
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
Co-authored-by: Paweł Szulc <paul.szulc@gmail.com>
Co-authored-by: Paweł Szulc <paul.szulc@gmail.com>
Co-authored-by: Paweł Szulc <paul.szulc@gmail.com>
Co-authored-by: Paweł Szulc <paul.szulc@gmail.com>
@EncodePanda
Copy link
Contributor

Hi @jaspervdj, is there anything else you would like us to do in this PR or is it ready to be merged?

EncodePanda and others added 2 commits January 20, 2020 10:45
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
@jaspervdj
Copy link
Member

Hey @EncodePanda, the code looks good to me now; I just need to find some time to manually play with this, try it on a few larger codebases and then it's good to go in -- I promise I'll work on getting that done before the end of the week.

@lukasz-golebiewski
Copy link
Member Author

lukasz-golebiewski commented Jan 21, 2020

Thanks for the review and the approve @jaspervdj !
We've noticed one "slight inconvenience" which is the removal of comments if any existed somewhere inside the data definition. We're going to spend some time on it and try to make sure they are preserved

@jaspervdj
Copy link
Member

Okay, great that you caught that! Another option you could consider is not formatting the data definition at all if there are any comments inside.

@lukasz-golebiewski
Copy link
Member Author

Good idea @jaspervdj! Looks like for now we can do what you suggested only for Haddock style comments, due to how https://hackage.haskell.org/package/haskell-src-exts-1.23.0/docs/Language-Haskell-Exts-Comments.html#v:associateHaddock works

Looks like the problem with comments being removed is more general (see #39) and probably needs to be solved in a separate PR

Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
@EncodePanda
Copy link
Contributor

We are almost there :) For now we will not format records that have comments in them but we have already a WIP that most likely will fix that (will arrive as a separate PR)

@EncodePanda EncodePanda self-requested a review January 23, 2020 16:38
Copy link
Contributor

@EncodePanda EncodePanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👯‍♂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants