From f5e9263e889717fc6cf821aa8c1ce57b5590614c Mon Sep 17 00:00:00 2001 From: phi Date: Sat, 16 Mar 2024 17:55:37 +0900 Subject: [PATCH] fix: ruff.toml --- pyproject.toml | 106 ------------------------------------------------- ruff.toml | 103 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 106 deletions(-) create mode 100644 ruff.toml diff --git a/pyproject.toml b/pyproject.toml index 88e0c99..b7b3fbb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,112 +58,6 @@ allow-direct-references = true [tool.hatch.build.targets.wheel] packages = ["src/timeout_executor"] - -[tool.ruff] -target-version = "py38" - -[tool.ruff.lint] -select = ["ALL"] -fixable = [ - "UP", - 'F401', # unused imports - "F522", # string-dot-format-extra-named-arguments - "F541", # f-string-missing-placeholders - "W292", # no-new-line-at-end-of-file - "E711", # none-comparison - "E712", # true-false-comparison - "E713", # not-in-test - "E714", # not-is-test - "I001", # unsorted-imports - "UP037", # quoted-annotation - "W293", # blank-line-with-whitespace - "RSE102", # unnecessary-paren-on-raise-exception - "SIM108", # if-else-block-instead-of-if-exp - "I002", # missing-required-import - "RUF100", # unused-noqa -] -ignore = [ - 'TD', # flake8-todos - 'E712', # TrueFalseComparison # sqlalchemy - "E711", # none-comparison # sqlalchemy - "D100", # public-module - "D104", # public-package - "D107", # public-init - "D201", # no-blank-line-before-function - "D202", # no-blank-line-after-function - "D203", # one-blank-line-before-class - "D204", # one-blank-line-after-class - "D211", # no-blank-line-before-class - "D212", # multi-line-summary-first-line - "D213", # multi-line-summary-second-line - "D400", # ends-in-period - "D401", # non-imperative-mood - "D403", # first-line-capitalized - "D406", # new-line-after-section-name - "D407", # dashed-underline-after-section - "D417", # undocumented-param - "D415", # ends-in-punctuation - "EM101", # raw-string-in-exception - "TRY003", # raise-vanilla-args - "ANN101", # missing-type-self - "ANN102", # missing-type-cls - "ANN401", # dynamically-typed-expression - "FBT002", # boolean-default-value-in-function-definition - "PGH003", # blanket-type-ignore - "SIM117", # multiple-with-statements # python3.8 - "B905", # zip-without-explicit-strict - "PD010", # use-of-dot-pivot-or-unstack - "D105", # undocumented-magic-method - "TD", # flake8-todos - "FIX", # flake8-fixme - "D413", # blank-line-after-last-section - # ruff format - "W191", # tab-indentation - "E111", # indentation-with-invalid-multiple - "E114", # indentation-with-invalid-multiple-comment - "E117", # over-indented - "D206", # indent-with-spaces - "D300", # triple-single-quotes - "Q000", # bad-quotes-inline-string - "Q001", # bad-quotes-multiline-string - "Q002", # bad-quotes-docstring - "Q003", # avoidable-escaped-quote - "COM812", # missing-trailing-comma - "COM819", # prohibited-trailing-comma - "ISC001", # single-line-implicit-string-concatenation - "ISC002", # multi-line-implicit-string-concatenation -] - -[tool.ruff.lint.per-file-ignores] -"./tests/**/*.py" = [ - "TCH001", - "TCH002", - "TCH003", - "S101", - "D101", - "ANN001", - "ANN201", - "PLR0133", - "W605", - "D103", - "D102", - "PLR2004", -] - -[tool.ruff.format] -indent-style = "space" -preview = true -quote-style = "double" -skip-magic-trailing-comma = true - -[tool.ruff.lint.isort] -known-local-folder = ["timeout_executor"] -required-imports = ["from __future__ import annotations"] -# ruff format -force-single-line = false -force-wrap-aliases = false -split-on-trailing-comma = false - [tool.pyright] include = ["src", "tests"] pythonVersion = '3.8' diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..f3f7486 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,103 @@ +target-version = "py38" + +[lint] +select = ["ALL"] +fixable = [ + "UP", + 'F401', # unused imports + "F522", # string-dot-format-extra-named-arguments + "F541", # f-string-missing-placeholders + "W292", # no-new-line-at-end-of-file + "E711", # none-comparison + "E712", # true-false-comparison + "E713", # not-in-test + "E714", # not-is-test + "I001", # unsorted-imports + "UP037", # quoted-annotation + "W293", # blank-line-with-whitespace + "RSE102", # unnecessary-paren-on-raise-exception + "SIM108", # if-else-block-instead-of-if-exp + "I002", # missing-required-import + "RUF100", # unused-noqa +] +ignore = [ + 'TD', # flake8-todos + 'E712', # TrueFalseComparison # sqlalchemy + "E711", # none-comparison # sqlalchemy + "D100", # public-module + "D104", # public-package + "D107", # public-init + "D201", # no-blank-line-before-function + "D202", # no-blank-line-after-function + "D203", # one-blank-line-before-class + "D204", # one-blank-line-after-class + "D211", # no-blank-line-before-class + "D212", # multi-line-summary-first-line + "D213", # multi-line-summary-second-line + "D400", # ends-in-period + "D401", # non-imperative-mood + "D403", # first-line-capitalized + "D406", # new-line-after-section-name + "D407", # dashed-underline-after-section + "D417", # undocumented-param + "D415", # ends-in-punctuation + "EM101", # raw-string-in-exception + "TRY003", # raise-vanilla-args + "ANN101", # missing-type-self + "ANN102", # missing-type-cls + "ANN401", # dynamically-typed-expression + "FBT002", # boolean-default-value-in-function-definition + "PGH003", # blanket-type-ignore + "SIM117", # multiple-with-statements # python3.8 + "B905", # zip-without-explicit-strict + "PD010", # use-of-dot-pivot-or-unstack + "D105", # undocumented-magic-method + "TD", # flake8-todos + "FIX", # flake8-fixme + "D413", # blank-line-after-last-section + # ruff format + "W191", # tab-indentation + "E111", # indentation-with-invalid-multiple + "E114", # indentation-with-invalid-multiple-comment + "E117", # over-indented + "D206", # indent-with-spaces + "D300", # triple-single-quotes + "Q000", # bad-quotes-inline-string + "Q001", # bad-quotes-multiline-string + "Q002", # bad-quotes-docstring + "Q003", # avoidable-escaped-quote + "COM812", # missing-trailing-comma + "COM819", # prohibited-trailing-comma + "ISC001", # single-line-implicit-string-concatenation + "ISC002", # multi-line-implicit-string-concatenation +] + +[lint.per-file-ignores] +"./tests/**/*.py" = [ + "TCH001", + "TCH002", + "TCH003", + "S101", + "D101", + "ANN001", + "ANN201", + "PLR0133", + "W605", + "D103", + "D102", + "PLR2004", +] + +[format] +indent-style = "space" +preview = true +quote-style = "double" +skip-magic-trailing-comma = true + +[lint.isort] +known-local-folder = ["timeout_executor"] +required-imports = ["from __future__ import annotations"] +# ruff format +force-single-line = false +force-wrap-aliases = false +split-on-trailing-comma = false \ No newline at end of file