From 09b5a26fb8beb45ba7b816255a592f4e37ca4c2a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Feb 2023 16:49:49 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- myst_parser/_docs.py | 2 -- myst_parser/config/main.py | 1 - myst_parser/mdit_to_docutils/base.py | 2 -- myst_parser/mdit_to_docutils/html_to_nodes.py | 1 - myst_parser/mocking.py | 1 - tests/test_sphinx/conftest.py | 1 - 6 files changed, 8 deletions(-) diff --git a/myst_parser/_docs.py b/myst_parser/_docs.py index 85b9e633..2df00023 100644 --- a/myst_parser/_docs.py +++ b/myst_parser/_docs.py @@ -58,7 +58,6 @@ def field_type(field): class MystConfigDirective(_ConfigBase): - option_spec = { "sphinx": directives.flag, "extensions": directives.flag, @@ -71,7 +70,6 @@ def run(self): text = self.table_header() count = 0 for name, value, field in config.as_triple(): - if field.metadata.get("deprecated"): continue diff --git a/myst_parser/config/main.py b/myst_parser/config/main.py index b4cd4237..cad71bc6 100644 --- a/myst_parser/config/main.py +++ b/myst_parser/config/main.py @@ -513,7 +513,6 @@ def merge_file_level( # validate each update fields = {name: (value, field) for name, value, field in config.as_triple()} for name, value in updates.items(): - if name not in fields: warning(MystWarnings.MD_TOPMATTER, f"Unknown field: {name}") continue diff --git a/myst_parser/mdit_to_docutils/base.py b/myst_parser/mdit_to_docutils/base.py index a45ebb16..1d76e6fc 100644 --- a/myst_parser/mdit_to_docutils/base.py +++ b/myst_parser/mdit_to_docutils/base.py @@ -320,7 +320,6 @@ def _render_finalise(self) -> None: # Add the wordcount, generated by the ``mdit_py_plugins.wordcount_plugin``. wordcount_metadata = self.md_env.get("wordcount", {}) if wordcount_metadata: - # save the wordcount to the sphinx BuildEnvironment metadata if self.sphinx_env is not None: meta = self.sphinx_env.metadata.setdefault(self.sphinx_env.docname, {}) @@ -1198,7 +1197,6 @@ def dict_to_fm_field_list( return field_list def render_table(self, token: SyntaxTreeNode) -> None: - # markdown-it table always contains at least a header: assert token.children header = token.children[0] diff --git a/myst_parser/mdit_to_docutils/html_to_nodes.py b/myst_parser/mdit_to_docutils/html_to_nodes.py index 454ca744..e327bbe8 100644 --- a/myst_parser/mdit_to_docutils/html_to_nodes.py +++ b/myst_parser/mdit_to_docutils/html_to_nodes.py @@ -82,7 +82,6 @@ def html_to_nodes( nodes_list = [] for child in root: - if child.name == "img": if "src" not in child.attrs: return [ diff --git a/myst_parser/mocking.py b/myst_parser/mocking.py index 563711f1..a15bbec8 100644 --- a/myst_parser/mocking.py +++ b/myst_parser/mocking.py @@ -343,7 +343,6 @@ def __init__( self.lineno = lineno def run(self) -> list[nodes.Element]: - from docutils.parsers.rst.directives.body import CodeBlock, NumberLines if not self.document.settings.file_insertion_enabled: diff --git a/tests/test_sphinx/conftest.py b/tests/test_sphinx/conftest.py index 6ce0cb91..0e25b6ce 100644 --- a/tests/test_sphinx/conftest.py +++ b/tests/test_sphinx/conftest.py @@ -65,7 +65,6 @@ def read( regress_ext=".html", replace=None, ): - outpath = path(os.path.join(str(app.srcdir), "_build", buildername, filename)) if not outpath.exists(): raise OSError(f"no output file exists: {outpath}")