Skip to content

Commit

Permalink
Merge pull request #113 from pydanny/use-ruff-for-isort
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Oct 13, 2023
2 parents a409f8a + dad9a95 commit 5fdd60a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
43 changes: 33 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ test = [
"black", # code auto-formatting
"black[jupyter]",
"coverage", # testing
"isort", # code auto-formatting
"mypy", # linting
"pytest", # testing
"ruff" # linting
Expand All @@ -60,15 +59,6 @@ documentation = "https://dj-notebook.readthedocs.io/"
[tool.setuptools]
package-dir = {"" = "src"}

# Isort
# -----

[tool.isort]
line_length = 99
profile = "black"
default_section = "THIRDPARTY"
lines_after_imports = 2


# Mypy
# ----
Expand All @@ -90,3 +80,36 @@ module = "tests.*"
allow_untyped_defs = true
disable_error_code = "attr-defined"

# Ruff
# ----

[tool.ruff]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
]
ignore = [
"E501", # line too long - black takes care of this for us
]

[tool.ruff.per-file-ignores]
# Allow unused imports in __init__ files as these are convenience imports
"**/__init__.py" = [ "F401" ]

[tool.ruff.isort]
lines-after-imports = 2
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"project",
"local-folder",
]

[tool.ruff.isort.sections]
"project" = [
"src",
"tests",
]
1 change: 0 additions & 1 deletion tests/test_dj_notebook.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from unittest.mock import patch

import pytest

from dj_notebook import Plus, activate
from dj_notebook.shell_plus import DiagramClass

Expand Down

0 comments on commit 5fdd60a

Please sign in to comment.