Modernize code
* Add pyproject.toml * Remove pylint/flake8 linting configuration * Add ruff configuration * Multiple code refactor * Add prints when watch option is enable
This commit is contained in:
parent
ce74e6135e
commit
933dea2b9e
6 changed files with 197 additions and 179 deletions
56
pyproject.toml
Normal file
56
pyproject.toml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
[project]
|
||||
name = 'umake'
|
||||
version = '1.0.0'
|
||||
requires-python = ">=3.8"
|
||||
|
||||
[tool.ruff]
|
||||
cache-dir = "/tmp/ruff"
|
||||
exclude = [
|
||||
".git",
|
||||
".ruff_cache",
|
||||
".venv"
|
||||
]
|
||||
|
||||
line-length = 120
|
||||
indent-width = 4
|
||||
|
||||
[tool.ruff.lint]
|
||||
preview = true
|
||||
select = ["A", "ARG", "B", "C", "E", "F", "FURB", "G", "I","ICN", "ISC", "PERF", "PIE", "PL", "PLE", "PT", "PTH",
|
||||
"Q", "RET", "RSE", "RUF", "SLF", "SIM", "T20", "TCH", "UP", "W"]
|
||||
ignore = ["implicit-return", "implicit-return-value", "missing-whitespace-after-keyword", "mutable-class-default",
|
||||
"print", "redefined-loop-name", "reimplemented-starmap", "suppressible-exception", "try-except-in-loop",
|
||||
"unsorted-imports"]
|
||||
|
||||
[tool.ruff.lint.flake8-quotes]
|
||||
inline-quotes = "single"
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
combine-as-imports = true
|
||||
force-sort-within-sections = true
|
||||
lines-after-imports = 2
|
||||
|
||||
[tool.ruff.lint.mccabe]
|
||||
max-complexity = 40
|
||||
|
||||
[tool.ruff.lint.pylint]
|
||||
max-args=16
|
||||
max-branches=42
|
||||
max-locals=64
|
||||
max-nested-blocks=8
|
||||
max-public-methods=64
|
||||
max-returns=12
|
||||
max-statements=128
|
||||
max-statements-in-try=64
|
||||
|
||||
[tool.isort]
|
||||
combine_as_imports = true
|
||||
force_sort_within_sections = true
|
||||
lexicographical = true
|
||||
lines_after_imports = 2
|
||||
multi_line_output = 4
|
||||
no_sections = false
|
||||
order_by_type = true
|
||||
|
||||
[tool.pyright]
|
||||
exclude = ["**/__pycache__", "**/.venv", "**/services", "web_front"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue