Skip to content

Commit

Permalink
chore: Replace isort, flake8, black and pyupgrade with Ruff
Browse files Browse the repository at this point in the history
It's 1 faster tool
  • Loading branch information
edgarrmondragon committed Jan 23, 2024
1 parent d734e4f commit 20a6910
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 184 deletions.
31 changes: 5 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,12 @@ repos:
exclude: (copier_template/.*|docs/.*|samples/.*\.json)
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 23.12.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
hooks:
- id: black
exclude: |
(?x)^(
copier_template/.*
)$
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
exclude: (copier_template/.*)

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.6.0

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.8.0'
Expand Down
150 changes: 28 additions & 122 deletions poetry.lock

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

27 changes: 17 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ packages = [
]

[tool.poetry.dependencies]
python = "<3.13,>=3.8.1"
python = "<3.13,>=3.8"
requests = "^2.25.1"
singer-sdk = ">=0.28,<0.35"
psycopg2-binary = "2.9.9"
Expand All @@ -42,9 +42,7 @@ sshtunnel = "0.4.0"
pytest = "^7.4.2"
mypy = "^1.6.1"
remote-pdb="2.1.0"
black = "^23.1.0"
flake8 = ">=6,<8"
isort = "^5.10.1"
ruff = "^0.1.14"
tox = "^4"
types-paramiko = "^3.3.0.0"
types-simplejson = "^3.19.0.2"
Expand All @@ -58,13 +56,8 @@ exclude = "tests"
module = ["sshtunnel"]
ignore_missing_imports = true

[tool.isort]
profile = "black"
multi_line_output = 3 # Vertical Hanging Indent
src_paths = "target_postgres"

[build-system]
requires = ["poetry-core>=1.0.8", "poetry-dynamic-versioning"]
requires = ["poetry-core==1.8.1", "poetry-dynamic-versioning==1.2.0"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.poetry.scripts]
Expand All @@ -80,3 +73,17 @@ pythonpath = [
enable = true
vcs = "git"
style = "semver"

[tool.ruff]
select = [
"F", # Pyflakes
"W", # pycodestyle warnings
"E", # pycodestyle errors
"I", # isort
"N", # pep8-naming
"D", # pydocsyle
]
target-version = "py38"

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

0 comments on commit 20a6910

Please sign in to comment.