Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions readthedocs/doc_builder/backends/mkdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
"""

import os

import structlog
import yaml
from django.conf import settings

from readthedocs.core.utils.filesystem import safe_open
from readthedocs.doc_builder.base import BaseBuilder
from readthedocs.doc_builder.exceptions import BuildUserError
from readthedocs.projects.constants import MKDOCS
from readthedocs.projects.constants import MKDOCS_HTML
from readthedocs.doc_builder.exceptions import ProjectConfigurationError



log = structlog.get_logger(__name__)
Expand Down Expand Up @@ -99,6 +100,10 @@ def build(self):
"--config-file",
os.path.relpath(self.yaml_file, self.project_path),
]

if not os.path.exists(self.yaml_file):
raise ProjectConfigurationError(ProjectConfigurationError.NOT_FOUND)

Copy link
Member

Choose a reason for hiding this comment

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

Please, move this code to show_config following the same pattern we are using for Sphinx. Take a look at its code at https://github.com/readthedocs/readthedocs.org/blob/main/readthedocs/doc_builder/backends/sphinx.py#L110-L124

if self.config.mkdocs.fail_on_warning:
build_command.append("--strict")
cmd_ret = self.run(
Expand Down