Skip to content

Commit

Permalink
add ruff as formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrd committed Oct 30, 2023
1 parent 5dbc41e commit 2097a5b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
10 changes: 7 additions & 3 deletions PathDict.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
}
],
"settings": {
"python.pythonPath": ".venv/bin/python",
"python.formatting.provider": "black",
"python.analysis.typeCheckingMode": "basic",
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff"
},
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
}
}
30 changes: 30 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,33 @@ pyinstrument = "^4.3.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
show-fixes = true
line-length = 120
select = [
"ANN", # annotations
"B", # bugbear
"C", # comprehensions
"E", # style errors
"F", # flakes
"I", # import sorting
"M", # meta
"N", # naming
"U", # upgrade
"W", # style warnings
"YTT", # sys.version
]
ignore = [
"ANN101", # missing type annotation for self
"ANN202", # Missing return type annotation for private function
"E501", # line length
"UP006", # use Dict (not possible in python 3.8)
"UP007", # use X | Y for union (not possible in python 3.8)
"UP035", # use typing Dict and List (not possible in python 3.8)
"W191", # indentation contains tabs
]

[tool.ruff.format]
indent-style = "tab"
quote-style = "double"

0 comments on commit 2097a5b

Please sign in to comment.