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

Don't require repo arg for building under certain conditions #303

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

starbelly
Copy link
Member

Most cases for using the build provider shouldn't require specifying a repo argument.
The exception is when there is more than one repo found and at least one has doc config set on the
repo.

@starbelly starbelly requested a review from ferd March 28, 2022 00:19
@starbelly starbelly linked an issue Mar 28, 2022 that may be closed by this pull request
Task when Task =:= undefined orelse Task =:= "docs" ->
case has_no_doc_provider(State, Repos) of
true ->
#{name => repo_not_set};
Copy link
Member

Choose a reason for hiding this comment

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

What's up with this magic value?

Copy link
Member Author

@starbelly starbelly Mar 28, 2022

Choose a reason for hiding this comment

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

name could be anything, but we have a clause for doc_opts/1 that matches on a map with name in it. I figured if we crash with passing this around, there's only one place it would be set.

Copy link
Member Author

Choose a reason for hiding this comment

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

Note : I'm going to adjust this, it's hacky.

@starbelly starbelly force-pushed the conditional-repo-req-on-build branch from 46f7383 to 4d11955 Compare April 2, 2022 19:35
@starbelly
Copy link
Member Author

@ferd I squashed and forced pushed

  1. Got rid of the hack in favor of just using the default hexpm repo which aligns with our current documentation.
  2. Don't do a bunch of checks to see if there are any repos with doc config, instead if you want to use repo with doc config, you must specify it.
  3. Added deprecation warning if a repo is used with doc config

Most cases for using the build provider shouldn't require specifying a repo argument.
The exception is when there is more than one repo found and at least one has doc config set on the
repo.

In addition, configuring documentation providers within repo config is deprecated and a warning will
be emitted if such config is detected.
@starbelly starbelly force-pushed the conditional-repo-req-on-build branch from 4d11955 to 4ddca38 Compare April 3, 2022 00:01
@starbelly starbelly merged commit b4e0a8f into erlef:main Apr 6, 2022
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.

build command should not require repo argument
2 participants