Skip to content

Add haddock-style-module configuration#135

Merged
brandonchinn178 merged 4 commits intomainfrom
chinn/haddock-style-module
Nov 11, 2022
Merged

Add haddock-style-module configuration#135
brandonchinn178 merged 4 commits intomainfrom
chinn/haddock-style-module

Conversation

@brandonchinn178
Copy link
Collaborator

@brandonchinn178 brandonchinn178 commented Nov 23, 2021

Blocked on #49?
Resolves #74

Adds a haddock-style-module option that specifies the haddock style to use specifically for the module docstring (when not set, resolves to whatever haddock-style is — the current behavior)

Tested with this file:

{- |
Module: Foo
-}

module Foo where

-- | This is a
-- multi line
-- haddock
foo :: Int
foo = 42

and this command:

$ stack exec -- fourmolu --haddock-style=single-line --haddock-style-module=multi-line Foo.hs

{- |
Module: Foo
-}
module Foo where

-- | This is a
-- multi line
-- haddock
foo :: Int
foo = 42

@brandonchinn178
Copy link
Collaborator Author

Orthogonal, but related, to #130

@brandonchinn178 brandonchinn178 force-pushed the chinn/haddock-style-module branch from f233a41 to cf2039e Compare January 20, 2022 23:48
@brandonchinn178 brandonchinn178 added the new config option Adds or would add new configuration option label Jan 24, 2022
@brandonchinn178 brandonchinn178 force-pushed the master branch 12 times, most recently from c7364ed to 40bcc74 Compare May 18, 2022 21:03
@brandonchinn178 brandonchinn178 force-pushed the chinn/haddock-style-module branch from cf2039e to fb5c57c Compare May 31, 2022 08:23
@brandonchinn178
Copy link
Collaborator Author

brandonchinn178 commented May 31, 2022

Checklist:

  • CHANGELOG.md has been updated
  • Configuration docs in README.md have been updated
  • fourmolu.yaml updated to stay in sync with config in README.md

@joncol
Copy link

joncol commented Nov 11, 2022

Hi @brandonchinn178! Any chance this might see a revival now that #49 is resolved?

@brandonchinn178
Copy link
Collaborator Author

Yup! I was wondering if anyone else wanted this or if it was just me 😛 I'll merge soon

@brandonchinn178 brandonchinn178 force-pushed the chinn/haddock-style-module branch from 90995c7 to 07c5cfd Compare November 11, 2022 18:22
@brandonchinn178 brandonchinn178 force-pushed the chinn/haddock-style-module branch from 07c5cfd to ef45822 Compare November 11, 2022 18:46
@brandonchinn178 brandonchinn178 merged commit c550536 into main Nov 11, 2022
@brandonchinn178 brandonchinn178 deleted the chinn/haddock-style-module branch November 11, 2022 19:33
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.

Support different comment types for module and function docstrings

2 participants