Skip to content

Remove load-time argv parsing#1148

Merged
emillon merged 1 commit intoocaml-ppx:masterfrom
emillon:remove-load-time-parsing
Nov 14, 2019
Merged

Remove load-time argv parsing#1148
emillon merged 1 commit intoocaml-ppx:masterfrom
emillon:remove-load-time-parsing

Conversation

@emillon
Copy link
Copy Markdown
Collaborator

@emillon emillon commented Nov 14, 2019

Conf.action had side effects as it immediately parsed Sys.argv at load time. This has to be delayed so that we can link the lib in a test suite for example.

`Conf.action` had side effects as it immediately parsed `Sys.argv` at
load time. This has to be delayed so that we can link the lib in a test
suite for example.
@emillon emillon force-pushed the remove-load-time-parsing branch from 66135e1 to 33d738e Compare November 14, 2019 14:29
Copy link
Copy Markdown
Collaborator

@Julow Julow left a comment

Choose a reason for hiding this comment

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

That's a good idea but we need more ! We should move that part of Conf into an other module, so that Conf API is smaller and better defined and can then be documented and tested more easily.

@emillon
Copy link
Copy Markdown
Collaborator Author

emillon commented Nov 14, 2019

This is the part that blocks linking, the rest can be improved later.

Copy link
Copy Markdown
Collaborator

@gpetiot gpetiot left a comment

Choose a reason for hiding this comment

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

Looks good

@emillon emillon merged commit 09714e1 into ocaml-ppx:master Nov 14, 2019
@emillon emillon deleted the remove-load-time-parsing branch November 14, 2019 15:21
@emillon
Copy link
Copy Markdown
Collaborator Author

emillon commented Nov 14, 2019

Thanks !

bogdan2412 pushed a commit to bogdan2412/ocamlformat that referenced this pull request Mar 28, 2020
`Conf.action` had side effects as it immediately parsed `Sys.argv` at
load time. This has to be delayed so that we can link the lib in a test
suite for example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants