Skip to content

Commit

Permalink
Enable flake8-tidy-imports in Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Jan 21, 2025
1 parent a535b4b commit d637764
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ select = [
"PGH", # pygrep-hooks
"PT", # flake8-pytest-style
"TC", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle
]
Expand All @@ -48,6 +49,9 @@ inline-quotes = "double"
exempt-modules = []
strict = true

[lint.flake8-tidy-imports]
ban-relative-imports = "all"

[lint.isort]
forced-separate = [
"tests",
Expand Down
7 changes: 3 additions & 4 deletions breathe/directives/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

from docutils.parsers.rst.directives import flag, unchanged_required

from breathe.directives import BaseDirective
from breathe.project import ProjectError
from breathe.renderer import RenderContext
from breathe.renderer.mask import NullMaskFactory
from breathe.renderer.sphinxrenderer import SphinxRenderer
from breathe.renderer.target import create_target_handler

from ..directives import BaseDirective
from ..project import ProjectError
from ..renderer.mask import NullMaskFactory


class _BaseFileDirective(BaseDirective):
"""Base class handle the main work when given the appropriate file and project info to work
Expand Down
3 changes: 1 addition & 2 deletions breathe/parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from typing import TYPE_CHECKING

from breathe import file_state_cache

from . import compound, index
from breathe.parser import compound, index

if TYPE_CHECKING:
from sphinx.application import Sphinx
Expand Down
4 changes: 2 additions & 2 deletions breathe/parser/compound.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from xml.dom import Node, minidom
from xml.parsers.expat import ExpatError

from . import compoundsuper as supermod
from .compoundsuper import MixedContainer
from breathe.parser import compoundsuper as supermod
from breathe.parser.compoundsuper import MixedContainer


class DoxygenTypeSub(supermod.DoxygenType):
Expand Down
2 changes: 1 addition & 1 deletion breathe/parser/compoundsuper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
from xml.dom import Node, minidom

from .. import filetypes
from breathe import filetypes

#
# User methods
Expand Down
2 changes: 1 addition & 1 deletion breathe/parser/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from xml.dom import minidom
from xml.parsers.expat import ExpatError

from . import indexsuper as supermod
from breathe.parser import indexsuper as supermod


class DoxygenTypeSub(supermod.DoxygenType):
Expand Down
2 changes: 1 addition & 1 deletion breathe/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pathlib import Path
from typing import TYPE_CHECKING

from .exception import BreatheError
from breathe.exception import BreatheError

if TYPE_CHECKING:
from sphinx.application import Sphinx
Expand Down

0 comments on commit d637764

Please sign in to comment.