Skip to content

Commit

Permalink
🎨 ruff integration (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingi3314 authored Feb 18, 2024
1 parent c0ba36c commit 6b75bbb
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 156 deletions.
39 changes: 17 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.9.0
hooks:
- id: pyupgrade
args: [--py311-plus]

- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.291
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
# run the linter
- id: ruff
args: [--fix]
exclude: "(alembic/)"
# run the formatter
- id: ruff-format
exclude: "(alembic/)"

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.8.0
hooks:
- id: "mypy"
additional_dependencies:
[
click,
pytest,
pydantic,
types-requests,
typer,
types-PyYAML,
types-toml,
fastapi,
click==8.1.7,
pytest==7.4.3,
pydantic==2.5.3,
types-requests===2.31.0.10,
typer==0.9.0,
types-PyYAML===6.0.12.12,
types-toml===0.10.8.7,
fastapi==0.109.2,
]
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"recommendations": [
"charliermarsh.ruff",
"ms-python.black-formatter",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.mypy-type-checker",
Expand Down
5 changes: 2 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"editor.formatOnSave": true,
"python.languageServer": "Pylance",
"python.analysis.typeCheckingMode": "off",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff"
},
"black-formatter.importStrategy": "fromEnvironment",
"ruff.importStrategy": "fromEnvironment",
"mypy-type-checker.importStrategy": "fromEnvironment",
"git.branchProtection": [
Expand Down
Loading

0 comments on commit 6b75bbb

Please sign in to comment.