From 0806fc035efea9eba54e08870010865679576373 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 16:47:16 +0000 Subject: [PATCH 1/5] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0) - [github.com/charliermarsh/ruff-pre-commit: v0.0.218 → v0.0.252](https://github.com/charliermarsh/ruff-pre-commit/compare/v0.0.218...v0.0.252) - [github.com/pre-commit/mirrors-mypy: v0.991 → v1.0.1](https://github.com/pre-commit/mirrors-mypy/compare/v0.991...v1.0.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d5ca3ea..f994417c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,18 +31,18 @@ repos: - id: isort - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.218 + rev: v0.0.252 hooks: - id: ruff args: ["--force-exclude"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.991 + rev: v1.0.1 hooks: - id: mypy args: [--config-file=pyproject.toml] From c92f5351ce07dfc9da356886553d1bf44745d1d8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 16:49:05 +0000 Subject: [PATCH 2/5] [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 86544fd4..48b7375d 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 e1bec56d..42be2720 100644 --- a/myst_parser/config/main.py +++ b/myst_parser/config/main.py @@ -514,7 +514,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 9ec3e115..c183d85a 100644 --- a/myst_parser/mdit_to_docutils/base.py +++ b/myst_parser/mdit_to_docutils/base.py @@ -297,7 +297,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, {}) @@ -1296,7 +1295,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 9c8848b4..a87b6dd3 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}") From 446d844ff3eb9ba088160257819f9164a2ff8e6e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 1 Mar 2023 10:09:34 +0000 Subject: [PATCH 3/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/syntax/examples/example.py | 1 + myst_parser/parsers/docutils_.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/syntax/examples/example.py b/docs/syntax/examples/example.py index 96f37722..0b7508c5 100644 --- a/docs/syntax/examples/example.py +++ b/docs/syntax/examples/example.py @@ -1,5 +1,6 @@ """An example Python file.""" + # start example class MyClass: """An example class.""" diff --git a/myst_parser/parsers/docutils_.py b/myst_parser/parsers/docutils_.py index dfce7856..21043503 100644 --- a/myst_parser/parsers/docutils_.py +++ b/myst_parser/parsers/docutils_.py @@ -329,7 +329,6 @@ def stylesheet_call(self, *args, **kwargs): class SimpleWriter(Writer): - settings_spec = filter_settings_spec( Writer.settings_spec, "template", From e9d88f428035f0a4f7d9640b10c9b8c5310d768e Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 1 Mar 2023 11:11:32 +0100 Subject: [PATCH 4/5] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f994417c..93d1c2db 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,6 @@ repos: rev: v0.0.252 hooks: - id: ruff - args: ["--force-exclude"] - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.0.1 From 45eafca50e2badcb1ddfc38001e2771a39c0790f Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 1 Mar 2023 11:14:43 +0100 Subject: [PATCH 5/5] Update pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 8f6de6dc..7e6a4fe0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,6 +111,7 @@ no_lines_before = "LOCALFOLDER" [tool.ruff] line-length = 100 extend-select = ["B0", "C4", "ICN", "ISC", "N", "RUF", "SIM"] +extend-ignore = ["RUF005"] [tool.mypy] show_error_codes = true