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

Use ruff for isort #113

Merged
merged 1 commit into from
Oct 13, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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