Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Fix #1578 - Redesign option parsing for main executable #1671

Conversation

gdziadkiewicz
Copy link
Contributor

@gdziadkiewicz gdziadkiewicz commented Feb 28, 2020

What has been done?

I extracted mode-specific GlobalOpts fields into separate types, updated the parsing logic to handle new types as an alternative and updated the places where GlobalOpts were used.

How did I test it?

Added unit tests for option parser exposed by Haskell.Ide.Engine.Options.

@jneira jneira requested a review from fendor February 28, 2020 07:39
Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, this looks very promising and exactly like what I had in mind!
Please re-request a review when your PR is ready for merge!

@gdziadkiewicz
Copy link
Contributor Author

I will investigate the build failures and mark it as ready to be reviewed after making it build on all envs.

@gdziadkiewicz
Copy link
Contributor Author

@fendor Could you also find a moment to do a review more focused on the style of the code and best practices? I'm willing to learn in the process and to do changes meant to make the new code consistent with the rest of the codebase.

@gdziadkiewicz gdziadkiewicz force-pushed the feature/#1578_-_Redesign_option_parsing_for_main_executable branch from dfb732b to ff6db7b Compare March 3, 2020 19:47
@alanz
Copy link
Collaborator

alanz commented Mar 3, 2020

As a minimum, please update the description so that when it lands we know what it is about, without having to refer to a (possibly no longer existent) github repo.

@gdziadkiewicz gdziadkiewicz force-pushed the feature/#1578_-_Redesign_option_parsing_for_main_executable branch from ff6db7b to 369ccfe Compare March 4, 2020 09:21
@gdziadkiewicz
Copy link
Contributor Author

@alanz I changed the commit message. Please check if it is acceptable now

@gdziadkiewicz gdziadkiewicz changed the title Fix #1578 Fix #1578 - Redesign option parsing for main executable Mar 4, 2020
@gdziadkiewicz gdziadkiewicz force-pushed the feature/#1578_-_Redesign_option_parsing_for_main_executable branch from 369ccfe to a77935f Compare March 5, 2020 14:50
@gdziadkiewicz
Copy link
Contributor Author

The CI fails don't seem to be connected to this change.

@gdziadkiewicz gdziadkiewicz marked this pull request as ready for review March 5, 2020 14:54
@gdziadkiewicz gdziadkiewicz force-pushed the feature/#1578_-_Redesign_option_parsing_for_main_executable branch from a77935f to 951b2be Compare March 5, 2020 14:58
Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I tried my best to be nitpicky, but I just have nothing to criticise except for line length (and even that is debatable and personal preference)! Your code was easy to read and easy to follow!
I can say nothing more than, great job!
I hope you decide, and can find the time, to contribute more!

<$> (ProjectLoadingOpts
<$> flag False True
( long "dry-run"
<> help "Perform a dry-run of loading files. Only searches for Haskell source files to load. Does nothing if run as LSP server."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line too long, limiting yourself to 80 chars per line makes it easier to read on small monitors


spec :: Spec
spec = do
let defaultGlobalOptions = GlobalOpts False Nothing Nothing False Nothing False (ProjectLoadingMode $ ProjectLoadingOpts False [])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line a bit too long, as well.

@fendor
Copy link
Collaborator

fendor commented Mar 7, 2020

We will merge next week, when some time has passed since the release

@fendor
Copy link
Collaborator

fendor commented Mar 7, 2020

We will merge next week, when some time has passed since the last release

@fendor fendor merged commit 0fc1c72 into haskell:master Mar 11, 2020
@gdziadkiewicz gdziadkiewicz deleted the feature/#1578_-_Redesign_option_parsing_for_main_executable branch March 12, 2020 10:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants