diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 21f579b47..7329680b6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,7 +28,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install "black==22.3.0" + python -m pip install ".[lint]" - name: Format with black run: black --check . @@ -44,7 +44,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install --upgrade "flake8>=6" + python -m pip install ".[lint]" - name: Lint with flake8 run: flake8 breathe diff --git a/breathe/apidoc.py b/breathe/apidoc.py index fdb1eb330..542b67a72 100644 --- a/breathe/apidoc.py +++ b/breathe/apidoc.py @@ -68,7 +68,7 @@ def write_file(name, text, args): def format_heading(level, text): """Create a heading of [1, 2 or 3 supported].""" - underlining = ["=", "-", "~",][ + underlining = ["=", "-", "~"][ level - 1 ] * len(text) return "%s\n%s\n\n" % (text, underlining) diff --git a/breathe/directives/__init__.py b/breathe/directives/__init__.py index 9988d6100..a67c94579 100644 --- a/breathe/directives/__init__.py +++ b/breathe/directives/__init__.py @@ -25,7 +25,7 @@ def warn( raw_text: str, *, rendered_nodes: Optional[Sequence[nodes.Node]] = None, - unformatted_suffix: str = "" + unformatted_suffix: str = "", ) -> List[nodes.Node]: raw_text = self.format(raw_text) + unformatted_suffix if rendered_nodes is None: diff --git a/breathe/filetypes.py b/breathe/filetypes.py index 4372d3639..5f56b13f8 100644 --- a/breathe/filetypes.py +++ b/breathe/filetypes.py @@ -2,6 +2,7 @@ A module to house the methods for resolving a code-blocks language based on filename (and extension). """ + from typing import Optional import os.path diff --git a/breathe/renderer/__init__.py b/breathe/renderer/__init__.py index 497d84236..fd581ff6b 100644 --- a/breathe/renderer/__init__.py +++ b/breathe/renderer/__init__.py @@ -26,7 +26,7 @@ def format_parser_error(name, error, filename, state, lineno, do_unicode_warning "", nodes.paragraph("", "", nodes.Text(warning)), nodes.paragraph("", "", nodes.Text(explanation)), - *unicode_explanation + *unicode_explanation, ), state.document.reporter.warning( warning + explanation + unicode_explanation_text, line=lineno diff --git a/examples/doxygen/pyexample.py b/examples/doxygen/pyexample.py index 34c09925d..104b67faa 100644 --- a/examples/doxygen/pyexample.py +++ b/examples/doxygen/pyexample.py @@ -3,6 +3,7 @@ # # More details. + ## Documentation for a function. # # More details. diff --git a/pyproject.toml b/pyproject.toml index b2006fb47..f898a8c47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,8 +54,8 @@ docs = [ "sphinxcontrib-spelling", ] lint = [ - "black==22.3.0", - "flake8>=6.0", + "black==24.10.0", + "flake8==7.1.1", "mypy>=1", "types-docutils", "types-Pygments",