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

Add 'Haddock' phase #10

Closed
chshersh opened this issue Jul 31, 2022 · 1 comment · Fixed by #15
Closed

Add 'Haddock' phase #10

chshersh opened this issue Jul 31, 2022 · 1 comment · Fixed by #15
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@chshersh
Copy link
Owner

When building dependencies, you can ask cabal to also build their documentation. This is represented by the Haddock step in the output like this:

Building     base-orphans-0.8.6 (lib)
Haddock      base-orphans-0.8.6 (lib)
Installing   base-orphans-0.8.6 (lib)
Completed    base-orphans-0.8.6 (lib)

Currently, this phase is not supported by dr-cabal but it should be pretty straightforward to add it. Implementation plan:

  1. Add new Haddock status here:

data Status
= Downloading
| Downloaded
| Starting
| Building
| Installing
| Completed
deriving stock (Show, Read, Eq, Ord, Enum, Bounded)

  1. Add the new phase here:

data Phase = Phase
{ phaseDownloading :: Word64
, phaseStarting :: Word64
, phaseBuilding :: Word64
, phaseInstalling :: Word64
}

  1. Update phases calculation:

entriesToPhase :: Word64 -> [(Status, Word64)] -> Phase

  1. Update legend:

legend :: [Text]
legend =
[ b "Legend"
, " " <> fmt [cyan] block <> " Downloading"
, " " <> fmt [blue] block <> " Starting"
, " " <> fmt [red] block <> " Building"
, " " <> fmt [yellow] block <> " Installing"
, ""
]

  1. Update profile output:

formatRow :: Text -> Phase -> Text
formatRow libName phase@Phase{..} = mconcat
[ fmtPrefix libName phase
, formatSinglePhase cyan phaseDownloading
, formatSinglePhase blue phaseStarting
, formatSinglePhase red phaseBuilding
, formatSinglePhase yellow phaseInstalling
]

@chshersh chshersh added enhancement New feature or request good first issue Good for newcomers labels Jul 31, 2022
@diasbruno
Copy link
Contributor

@chshersh I'd like to contribute. Already start working on this one?

chshersh pushed a commit that referenced this issue Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants