Skip to content

Commit

Permalink
Replaced isort, black, and pylint with ruff.
Browse files Browse the repository at this point in the history
  • Loading branch information
fmind committed Feb 25, 2024
1 parent ab5a9b5 commit 1c73c3f
Show file tree
Hide file tree
Showing 33 changed files with 303 additions and 325 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: poetry install --with dev,checks,formats
- run: poetry install --with dev,checks
- run: poetry run invoke checks
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.cache/
.coverage*
.mypy_cache/
.ruff_cache/
.pytest_cache/

# Editor
Expand Down
10 changes: 3 additions & 7 deletions mlops-python-package.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,15 @@
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "ms-python.black-formatter"
"editor.defaultFormatter": "charliermarsh.ruff",
},
},
"extensions": {
"recommendations": [
"charliermarsh.ruff",
"dchanco.vsc-invoke",
"ms-python.black-formatter",
"ms-python.isort",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.python",
"ms-python.vscode-pylance",
"redhat.vscode-yaml",
]
}
}
}
175 changes: 30 additions & 145 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 17 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,42 +44,43 @@ pdoc = "^13.1.1"
[tool.poetry.group.checks.dependencies]
coverage = "^7.4.1"
mypy = "^1.8.0"
pylint = "^3.0.3"
pytest = "^8.0.0"
pytest-cov = "^4.1.0"
pytest-xdist = "^3.5.0"
pandera = { extras = ["mypy"], version = "^0.18.0" }

[tool.poetry.group.formats.dependencies]
black = "^24.1.1"
isort = "^5.13.2"
ruff = "^0.2.2"

[tool.poetry.group.notebooks.dependencies]
ipykernel = "^6.29.0"
nbformat = "^5.9.2"

# CONFIGURATIONS

[tool.black]
line-length = 120

[tool.coverage.run]
branch = true
source = ["src"]

[tool.isort]
line_length = 120
profile = "black"

[tool.mypy]
check_untyped_defs = true
ignore_missing_imports = true
plugins = ["pandera.mypy", "pydantic.mypy"]

[tool.pylint.MASTER]
disable = ['too-few-public-methods', 'too-many-arguments', 'too-many-locals']
max-line-length = 120
extension-pkg-whitelist = "pydantic"
[tool.ruff]
fix = true
line-length = 100
target-version = "py312"

[tool.ruff.format]
docstring-code-format = true

[tool.ruff.lint]
select = ["D"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D100", "D103"]

# SYSTEMS

Expand Down
1 change: 0 additions & 1 deletion src/bikes/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def parse_file(path: str) -> Config:
Config: representation of the config file.
"""
any_path = AnyPath(path)
# pylint: disable=no-member
text = any_path.read_text() # type: ignore
config = OmegaConf.create(text)
return config
Expand Down
Loading

0 comments on commit 1c73c3f

Please sign in to comment.