-
Notifications
You must be signed in to change notification settings - Fork 138
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
Action/Server: rewrite showFroms to be clearer #392
Open
Profpatsch
wants to merge
9
commits into
ndmitchell:master
Choose a base branch
from
Profpatsch:action-server-showFroms-rewrite
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Action/Server: rewrite showFroms to be clearer #392
Profpatsch
wants to merge
9
commits into
ndmitchell:master
from
Profpatsch:action-server-showFroms-rewrite
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cc @smatting |
The `local` and `haddock` booleans are only used for determining the URLs to generate, so let’s make that clear.
The function does not really deduplicate the elements, it takes and groups. :)
Upstream does not think shadowing should be avoided, so let’s undo the changes to shadowing. Same with incomplete pattern warnings, we’ll just let it crash for now. Also drop the `Is*` prefix for the URL constructors.
CI unfortunately uses -Werror and tests against more modern versions of GHC, so any new errors will only appear on CI.
The way the template was filled was rather hard to follow. This tries to remedy it by splitting the code which infers the data from the list of targets, and the code which generates the HTML. The logic should be exactly the same, but we use a sort->groupBy to stable-sort Targets into their packages.
Profpatsch
force-pushed
the
action-server-showFroms-rewrite
branch
from
March 19, 2023 16:29
b6aa989
to
e65973c
Compare
Once #391 is merged, this is only one commit. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(This contains some of the refactor commits from #391, only the last commit changes showFroms substantially)
This pulls apart the display logic and the data munging in
showFroms
, for ease of understanding.The resulting code is a bit longer, but uses a nice to understand pipeline of
sortOn
,groupOn
andmapMaybe
.The main complications came from the fact that both the
packageName
and thetargetModule
are optional fields, but now it should be fairly straight forward.