From d248d5ad75e4e7e8164566f527af731879b53e09 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 Jan 2023 15:49:49 +0530 Subject: [PATCH] Move to pyproject.toml and ruff --- pyproject.toml | 22 ++++++++++++++++++++++ session.vim | 6 +++--- setup.cfg | 27 --------------------------- 3 files changed, 25 insertions(+), 30 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..6a6c9390a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +[tool.mypy] +files = 'kitty,kittens,glfw,*.py,docs/conf.py,shell-integration/ssh/askpass.py' +no_implicit_optional = true +sqlite_cache = true +cache_fine_grained = true +warn_redundant_casts = true +warn_unused_ignores = true +warn_return_any = true +warn_unreachable = true +warn_unused_configs = true +check_untyped_defs = true +disallow_untyped_defs = true +disallow_untyped_decorators = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +strict = true +no_implicit_reexport = true + +[tool.ruff] +line-length = 160 +target-version = 'py38' +select = ['E', 'F'] diff --git a/session.vim b/session.vim index 33950b8f8..421c88b45 100644 --- a/session.vim +++ b/session.vim @@ -1,9 +1,9 @@ " Scan the following dirs recursively for tags -let g:project_tags_dirs = ['kitty', 'kittens'] +let g:project_tags_dirs = ['kitty', 'kittens', 'tools'] if exists('g:ale_linters') - let g:ale_linters['python'] = ['mypy', 'flake8'] + let g:ale_linters['python'] = ['mypy', 'ruff'] else - let g:ale_linters = {'python': ['mypy', 'flake8']} + let g:ale_linters = {'python': ['mypy', 'ruff']} endif let g:ale_python_mypy_executable = './mypy-editor-integration' let g:ycm_python_binary_path = 'python3' diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 00ace6e55..000000000 --- a/setup.cfg +++ /dev/null @@ -1,27 +0,0 @@ -[flake8] -max-line-length = 160 -exclude==template.py,linux-package -extend_ignore=W503,E203 - -[isort] -profile = black -combine_as_imports = True -multi_line_output = 5 - -[mypy] -files = kitty,kittens,glfw,*.py,docs/conf.py,shell-integration/ssh/askpass.py -no_implicit_optional = True -sqlite_cache = True -cache_fine_grained = True -warn_redundant_casts = True -warn_unused_ignores = True -warn_return_any = True -warn_unreachable = True -warn_unused_configs = True -check_untyped_defs = True -disallow_untyped_defs = True -disallow_untyped_decorators = True -disallow_untyped_calls = True -disallow_incomplete_defs = True -strict = True -no_implicit_reexport = True