Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
project_dir, repo_url="https://github.com/timothycrosley/examples"
) == {
"edit_uri": "edit/master/",
"repo_name": "examples",
"repo_url": "https://github.com/timothycrosley/examples",
}
assert config.repository(
project_dir, repo_url="https://bitbucket.org/atlassian/stash-example-plugin.git"
) == {
"edit_uri": "src/default/docs/",
"repo_name": "stash-example-plugin",
"repo_url": "https://bitbucket.org/atlassian/stash-example-plugin",
}
assert config.repository(
project_dir, repo_url="git@bitbucket.org:atlassian/stash-example-plugin.git"
) == {
"edit_uri": "src/default/docs/",
"repo_name": "stash-example-plugin",
"repo_url": "https://bitbucket.org/atlassian/stash-example-plugin",
}
assert config.repository(project_dir, repo_url="not_actually_a_valid_url") == {
"repo_name": "not_actually_a_valid_url",
"repo_url": "not_actually_a_valid_url",
}
assert config.repository(
project_dir, repo_url="https://gitlab.ci.token:password@gitlab.net/app.git"
) == {"edit_uri": "edit/master/", "repo_name": "app", "repo_url": "https://gitlab.net/app"}
output_dir: str = "site",
) -> dict:
"""Returns the configuration associated with a project.
- *directory*: The root folder of your project.
- *config_file*: The [TOML](https://github.com/toml-lang/toml#toml) formatted
config file you wish to use.
- *modules*: One or more modules to include in the configuration for reference rendering
"""
overrides: Dict[str, Union[str, list]] = {}
if modules:
overrides["modules"] = modules
if output_dir:
overrides["output_dir"] = output_dir
directory = directory if directory else os.getcwd()
return config.project(directory=directory, config_file=config_file, **overrides)