Skip to content

Leading arrows - #95

Closed
expipiplus1 wants to merge 6 commits into
fourmolu:mainfrom
expipiplus1:joe-align-leading-arrow
Closed

expipiplus1 wants to merge 6 commits into
fourmolu:mainfrom
expipiplus1:joe-align-leading-arrow

Conversation

@expipiplus1

@expipiplus1 expipiplus1 commented Jun 12, 2021 •

Copy link
Copy Markdown
Contributor

This adds a --leading-arrows option and closes #86

It's currently on top of my alignment branch for my convenience, I don't
think it should be that hard to extract though

I've extracted it from on top of my align work, although it's a more convenient for me to have it on there. I'll be keeping that up to date on this branch (joe-align-leading) https://github.com/expipiplus1/fourmolu/tree/joe-align-leading

CC @dpwiz

@expipiplus1

expipiplus1 commented Jun 12, 2021 •

Copy link
Copy Markdown
Contributor Author

TODO

data/examples/declaration/class/default-signatures-four-out.hs

-    bar ::
-        String ->
-        String ->
-        a
+    bar
+        :: String
+        -> String
+        -> a

Putting :: on the next line from bar looks weird (same for a few other tests including data/examples/declaration/data/field-layout/gadt-four-out.hs). This is much less of an issue with an indentation of 2 however.

GADTs sometimes look weird.

Should data/examples/declaration/value/function/typed-expressions-four-out.hs have an indented ::

in:

foo x = x::Int
bar x = Just x ::
  Maybe String

out:

foo x = x :: Int
bar x =
    Just x
    :: Maybe String

@expipiplus1
expipiplus1 force-pushed the joe-align-leading-arrow branch from 3f77e03 to 294872a Compare June 12, 2021 12:17
@expipiplus1
expipiplus1 force-pushed the joe-align-leading-arrow branch from 294872a to 30e5e59 Compare June 13, 2021 10:56
@expipiplus1

Copy link
Copy Markdown
Contributor Author

OK, I've fixed the GADT weirdness, for some reason in Ormolu the existing rendering for GADTs duplicated lots of work from p_hsType

@expipiplus1

Copy link
Copy Markdown
Contributor Author

@dpwiz

dpwiz commented Jun 13, 2021

Copy link
Copy Markdown

You're awesome and your dog is awesome!

@expipiplus1

Copy link
Copy Markdown
Contributor Author

image

@expipiplus1

Copy link
Copy Markdown
Contributor Author

If I were to fix the merge conflicts would it stand a chance of getting merged? I think it's quite a sought after feature.

@dpwiz

dpwiz commented Oct 28, 2021

Copy link
Copy Markdown

It would be merged right away into our fourmolu fork (fourfourmolu? sixteenmolu?).

@georgefst georgefst mentioned this pull request Oct 30, 2021
@brandonchinn178 brandonchinn178 added the new config option Adds or would add new configuration option label Jan 24, 2022
@arybczak

arybczak commented Apr 6, 2022

Copy link
Copy Markdown

Hey. What is the status of this PR? It would be great to have this in fourmolu as "hanging arrows" is not the style I've seen anyone use when writing code without a formatter.

@expipiplus1

Copy link
Copy Markdown
Contributor Author

Hey. What is the status of this PR? It would be great to have this in fourmolu as "hanging arrows" is not the style I've seen anyone use when writing code without a formatter.

Probably depends on #49

@brandonchinn178
brandonchinn178 force-pushed the master branch 10 times, most recently from d85cd0c to 3a667cc Compare May 18, 2022 19:20
@brandonchinn178
brandonchinn178 force-pushed the master branch 2 times, most recently from c7364ed to 40bcc74 Compare May 18, 2022 21:03
@brandonchinn178

Copy link
Copy Markdown
Collaborator

👋 @expipiplus1
Thank you for opening this PR and being patient while we sorted out how to handle all the new contributions for new configuration options!

If you haven't noticed, we finally merged in a new testing framework for configuration options (#169)! This means we can finally address the backlog of open PRs.

Please do the following steps

  • Rebase against main

    git remote add upstream [email protected]:fourmolu/fourmolu
    git fetch upstream
    git rebase -i upstream/main
  • Resolve merge conflicts

  • Ensure CHANGELOG.md has been updated

  • Ensure configuration docs in README.md have been updated

  • Ensure fourmolu.yaml updated to stay in sync with config in README.md

  • Ensure tests have been added

You can use #135 as a reference for this checklist.

@expipiplus1

expipiplus1 commented Jun 1, 2022 via email

Copy link
Copy Markdown
Contributor Author

@3kyro

3kyro commented Jun 20, 2022

Copy link
Copy Markdown
Contributor

@expipiplus1 I can try rebasing your branch and adding tests if you don't mind.

@expipiplus1

expipiplus1 commented Jun 20, 2022 via email

Copy link
Copy Markdown
Contributor Author

@3kyro 3kyro mentioned this pull request Jun 22, 2022
4 tasks done
@brandonchinn178

Copy link
Copy Markdown
Collaborator

Closing in favor of #209

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

Labels

new config option Adds or would add new configuration option

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Leading arrows in types

6 participants