Skip to content

Commit

Permalink
Improve lint tools (#1016)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Turner <[email protected]>
  • Loading branch information
Rotzbua and AA-Turner authored Jan 21, 2025
1 parent d70d97f commit 01a82c3
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion breathe/apidoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def write_file(name, text, args):

def format_heading(level, text):
"""Create a heading of <level> [1, 2 or 3 supported]."""
underlining = ["=", "-", "~",][
underlining = ["=", "-", "~"][
level - 1
] * len(text)
return "%s\n%s\n\n" % (text, underlining)
Expand Down
2 changes: 1 addition & 1 deletion breathe/directives/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions breathe/filetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion breathe/renderer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions examples/doxygen/pyexample.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
# More details.


## Documentation for a function.
#
# More details.
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 01a82c3

Please sign in to comment.