Skip to content

Commit 391b0f6

Browse files
committed
fixed lint issues as well as get_mkdocs_yaml_path
1 parent 6f8a055 commit 391b0f6

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

readthedocs/projects/models.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,6 @@ def conf_file(self, version=LATEST):
972972
)
973973

974974
raise ProjectConfigurationError(ProjectConfigurationError.NOT_FOUND)
975-
976975

977976
def yaml_file(self, version=LATEST):
978977
"""Find a mkdocs ``mkdocs.yml`` file in the project checkout."""
@@ -981,8 +980,7 @@ def yaml_file(self, version=LATEST):
981980
files = self.full_find("mkdocs.yml", version)
982981
if len(files) == 1:
983982
return files[0]
984-
## TODO Handle for multiple Files
985-
983+
# TODO: Handle for multiple Files
986984
raise MkDocsYAMLParseError(MkDocsYAMLParseError.NOT_FOUND)
987985

988986
def conf_dir(self, version=LATEST):
@@ -991,11 +989,9 @@ def conf_dir(self, version=LATEST):
991989
return os.path.dirname(conf_file)
992990

993991
def yaml_dir(self, version=LATEST):
994-
conf_file = self.conf_file(version)
995-
if conf_file:
996-
return os.path.dirname(conf_file)
997-
998-
992+
yaml_file = self.yaml_file(version)
993+
if yaml_file:
994+
return os.path.dirname(yaml_file)
999995

1000996
@property
1001997
def has_good_build(self):

readthedocs/rtd_tests/tests/test_doc_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ def test_project_without_mkdocs_yaml(
150150
_,
151151
docs_dir,
152152
):
153-
"""
153+
"""
154154
Test for a project without ``mkdocs.yaml`` file.
155155
156156
When this happen, the ``get_mkdocs_yaml_path`` raises a
157-
``ProjectConfigurationError`` which is captured by our own code.
157+
``MkDocsYAMLParseError`` which is captured by our own code.
158158
"""
159159
tmp_dir = tempfile.mkdtemp()
160160
checkout_path.return_value = tmp_dir

0 commit comments

Comments
 (0)