Skip to content

Commit 297aa25

Browse files
committed
Update docstrings
1 parent d8c2131 commit 297aa25

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

readthedocs/rtd_tests/utils.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ def make_test_git():
6060
# URL are not allowed and using a real URL will require Internet to clone
6161
# the repo
6262
check_output(['git', 'checkout', '-b', 'submodule', 'master'], env=env)
63-
add_submodule_without_cloning(
63+
add_git_submodule_without_cloning(
6464
directory, 'foobar', 'https://foobar.com/git'
6565
)
6666
check_output(['git', 'add', '.'], env=env)
6767
check_output(['git', 'commit', '-m"Add submodule"'], env=env)
6868

6969
# Add an invalid submodule URL in the invalidsubmodule branch
7070
check_output(['git', 'checkout', '-b', 'invalidsubmodule', 'master'], env=env)
71-
add_submodule_without_cloning(
71+
add_git_submodule_without_cloning(
7272
directory, 'invalid', '[email protected]:rtfd/readthedocs.org.git'
7373
)
7474
check_output(['git', 'add', '.'], env=env)
@@ -80,12 +80,19 @@ def make_test_git():
8080

8181

8282
@restoring_chdir
83-
def add_submodule_without_cloning(directory, submodule, url):
83+
def add_git_submodule_without_cloning(directory, submodule, url):
8484
"""
8585
Add a submodule without cloning it.
8686
8787
We write directly to the git index, more details in:
8888
https://stackoverflow.com/a/37378302/2187091
89+
90+
:param directory: The directory where the git repo is
91+
:type directory: str
92+
:param submodule: The name of the submodule to be created
93+
:type submodule: str
94+
:param url: The url where the submodule points to
95+
:type url: str
8996
"""
9097
env = environ.copy()
9198
env['GIT_DIR'] = pjoin(directory, '.git')

readthedocs/vcs_support/backends/git.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,16 @@ def validate_submodules(self, config):
9696
9797
:returns: tuple(bool, list)
9898
99-
Returns true if all required submodules URLs are valid.
99+
Returns `True` if all required submodules URLs are valid.
100100
Returns a list of all required submodules:
101101
- Include is `ALL`, returns all submodules avaliable.
102102
- Include is a list, returns just those.
103103
- Exclude is `ALL` - this should never happen.
104104
- Exlude is a list, returns all avaliable submodules
105105
but those from the list.
106+
107+
Returns `False` if at least one submodule is invalid.
108+
Returns the list of invalid submodules.
106109
"""
107110
repo = git.Repo(self.working_dir)
108111
submodules = {

0 commit comments

Comments
 (0)