-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ruff for code linting (#12)
* feat: add ruff requirement and configuration * style: apply ruff * style: remove now unnecessary # noqa comments * feat: remove dead code? * build: add python version constraint on ruff * style: add isort to avoid multi-line imports * build: fix requirements * fix: use more general exception
- Loading branch information
Showing
17 changed files
with
117 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.ruff] | ||
ignore = [ | ||
"E501", | ||
] | ||
select = [ | ||
"E", # pycodestyle errors | ||
"W", # pycodestyle warnings | ||
"F", # Pyflakes | ||
"Q", # flake8-quotes | ||
] | ||
|
||
[tool.ruff.per-file-ignores] | ||
# Ignore unused imports in __init__ files | ||
"__init__.py" = ["F401"] | ||
|
||
|
||
[tool.isort] | ||
multi_line_output = 9 | ||
profile = "black" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env python | ||
|
||
if __name__ == "__main__": | ||
from setuptools import setup, find_packages | ||
from setuptools import find_packages, setup | ||
|
||
setup(name="weasel", packages=find_packages()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
from ._util import app # noqa: F401 | ||
from ._util import app | ||
|
||
# These are the actual functions, NOT the wrapped CLI commands. The CLI commands | ||
# are registered automatically and won't have to be imported here. | ||
from .cli.assets import project_assets # noqa: F401 | ||
from .cli.clone import project_clone # noqa: F401 | ||
from .cli.document import project_document # noqa: F401 | ||
from .cli.dvc import project_update_dvc # noqa: F401 | ||
from .cli.pull import project_pull # noqa: F401 | ||
from .cli.push import project_push # noqa: F401 | ||
from .cli.run import project_run # noqa: F401 | ||
from .cli.assets import project_assets | ||
from .cli.clone import project_clone | ||
from .cli.document import project_document | ||
from .cli.dvc import project_update_dvc | ||
from .cli.pull import project_pull | ||
from .cli.push import project_push | ||
from .cli.run import project_run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
import sys | ||
|
||
if sys.version_info[:2] >= (3, 8): # Python 3.8+ | ||
from typing import Literal | ||
else: | ||
from typing_extensions import Literal # noqa: F401 | ||
|
||
|
||
is_windows = sys.platform.startswith("win") | ||
is_linux = sys.platform.startswith("linux") | ||
is_osx = sys.platform == "darwin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.