Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve lint tools #1016

Merged
merged 4 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
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 = ["=", "-", "~"][
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved
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
Loading