Skip to content
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

Update .stylish-haskell #680

Merged
merged 2 commits into from Mar 11, 2018

Conversation

Projects
None yet
4 participants
@phadej
Copy link
Member

commented Jan 19, 2017

With one file formatted as an example.

AFAICS, this is only configuration where indentation/alignment won't change globally if you add/remove long module name or qualified imports.

One option would be to have short lists right after the module name, but there isn't such configuration option in stylish-haskell atm.

@phadej phadej requested a review from jkarni Jan 19, 2017

@fizruk

This comment has been minimized.

Copy link
Member

commented Jan 19, 2017

I'm not a big fan of aligned imports anyway, but I'm all for simpler diffs. Looks good to me! 👍

@phadej

This comment has been minimized.

Copy link
Member Author

commented Jan 21, 2017

I'd like others @haskell-servant/maintainers to comment, as I plan to reformat everything, and try to remember to do that regularly in the future

@alpmestan

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2017

Do we really want to stick so hard to stylish haskell? I won't fight it, but I'll never encourage it either =)

@phadej

This comment has been minimized.

Copy link
Member Author

commented Jan 22, 2017

@alpmestan looking across servant codebase, the import styles vary a lot, what worse even inside single file. As a contributor I'm always confused "now I have to add new module import, where and how should I put it". From that POV uniform style will help.

I'm not the huge fan of the style proposed, but it's one of diff friendly ones.

Another variant is to separate explicit import lists and qualified imports into two groups:

import Data.Maybe
       (mapMaybe)
import Data.List
       (foldl')
import GHC.Generics
       (Generic)

-- not `as` isn’t indented
import qualified Data.ByteString as BS
import qualified Data.Text as T

or third:

import Data.Maybe
       (mapMaybe, fromJust, isNothing, catMaybe)
import Data.List (foldl')
import GHC.Generics (Generic)

import qualified Data.ByteString as BS
import qualified Data.Text as T

(third isn’t supported by stylish-haskell, but it’s an easy addition)

@jkarni

This comment has been minimized.

Copy link
Member

commented Jan 24, 2017

I'm in favor of a unified style, but don't much care for which, so I'm happy either way here.

@phadej phadej force-pushed the phadej:stylish-haskell branch from fc19cd5 to 2f39cfb Jan 28, 2017

@phadej phadej force-pushed the phadej:stylish-haskell branch from 2f39cfb to dcdf87b May 14, 2017

@ivan-m ivan-m referenced this pull request Oct 5, 2017

Closed

Fix up .stylish-haskell.yaml #814

@phadej phadej force-pushed the phadej:stylish-haskell branch from dcdf87b to 8058891 Mar 11, 2018

@phadej

This comment has been minimized.

Copy link
Member Author

commented Mar 11, 2018

I'm merging this. I'm so used to %!styli<tab> to reformat imports, and even this format is vertically verbose, it's somewhat diff-friendliest

@phadej phadej closed this Mar 11, 2018

@phadej phadej reopened this Mar 11, 2018

@phadej phadej merged commit 6d1ae0d into haskell-servant:master Mar 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@phadej phadej deleted the phadej:stylish-haskell branch Mar 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.