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

Issue #64/update linting tools #65

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
15 changes: 6 additions & 9 deletions .github/workflows/rdock-utils.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: lint
uses: chartboost/ruff-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -36,15 +39,9 @@ jobs:
cache-from: type=gha,scope=rdock-utils
cache-to: type=gha,mode=max,scope=rdock-utils
load: true

- name: flake8
run: docker run --rm -v $PWD/rdock-utils:/rdock-utils -w /rdock-utils ghcr.io/cbdd/rdock-utils:dev flake8 .

- name: black
run: docker run --rm -v $PWD/rdock-utils:/rdock-utils -w /rdock-utils ghcr.io/cbdd/rdock-utils:dev black --check .

- name: isort
run: docker run --rm -v $PWD/rdock-utils:/rdock-utils -w /rdock-utils ghcr.io/cbdd/rdock-utils:dev isort --check .

- name: mypy
run: docker run --rm -v $PWD/rdock-utils:/rdock-utils -w /rdock-utils ghcr.io/cbdd/rdock-utils:dev mypy .

- name: run tests
run: docker run --rm -v $PWD/rdock-utils:/rdock-utils -w /rdock-utils ghcr.io/cbdd/rdock-utils:dev pytest -v .
21 changes: 5 additions & 16 deletions rdock-utils/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,17 @@
"vscode": {
"settings": {
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black",
"python.linting.mypyEnabled": false,
"isort.check": true,
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"tests"
],
"python.formatting.blackArgs": [
"--line-length",
"119"
],
"isort.args": [
"--profile",
"black"
],
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"editor.defaultFormatter": "charliermarsh.ruff"
},
"editor.formatOnSave": true,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000
},
Expand All @@ -40,7 +28,8 @@
"littlefoxteam.vscode-python-test-adapter",
"ms-vsliveshare.vsliveshare",
"mhutchie.git-graph",
"ms-toolsai.jupyter"
"ms-toolsai.jupyter",
"charliermarsh.ruff"
]
}
}
Expand Down
52 changes: 42 additions & 10 deletions rdock-utils/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,48 @@ sdfield = "rdock_utils.sdfield:main"
[project.urls]
Repository = "https://github.com/CBDD/rDock.git"

[tool.black]
[tool.ruff]
line-length = 119
target-version = ['py312']
target-version = "py312"
exclude = [".git","__pycache__"]

[tool.isort]
profile = "black"
line_length = 119
combine_as_imports = true
[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "I"]
ignore = ["E231","E501","E203"]

import_heading_stdlib = "Standard Library"
import_heading_thirdparty = "Dependencies"
import_heading_firstparty = "From apps"
import_heading_localfolder = "Local imports"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.mypy]
python_version = "3.12"
pretty = true
show_error_context = true
show_error_codes = true

follow_imports = "silent"
ignore_missing_imports = true

disallow_incomplete_defs = true
disallow_any_generics = true
disallow_subclassing_any = false
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_untyped_decorators = true

warn_unused_configs = true
warn_unreachable = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true

check_untyped_defs = true

no_implicit_optional = true
no_implicit_reexport = false

strict_equality = true

exclude = ['^setup\.py$']
4 changes: 1 addition & 3 deletions rdock-utils/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
black
flake8
isort
ruff
mypy
pytest
36 changes: 0 additions & 36 deletions rdock-utils/setup.cfg

This file was deleted.