From fdbb56b1d10b8ab8edd2204b90053027c4512b9e Mon Sep 17 00:00:00 2001 From: Kartik Singhal Date: Fri, 2 Feb 2024 08:48:36 -0700 Subject: [PATCH] chore(ruff): upgrade to ruff v0.2.0 (#122) --- .pre-commit-config.yaml | 2 +- requirements.txt | 2 +- ruff.toml | 19 +++++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f64e26e..bcc44f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - black==23.10.1 - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.15 + rev: v0.2.0 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/requirements.txt b/requirements.txt index 0701a4d..76c57a8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ pre-commit==3.6.0 pydata_sphinx_theme==0.15.2 pytest==8.0.0 pytket==1.24.0 -ruff==0.1.15 +ruff==0.2.0 setuptools_scm==8.0.4 sphinx==7.2.6 wasmtime==17.0.0 diff --git a/ruff.toml b/ruff.toml index bfeadec..46be99e 100644 --- a/ruff.toml +++ b/ruff.toml @@ -4,12 +4,12 @@ target-version = "py310" line-length = 88 preview = true -select = [ +lint.select = [ "E", # pycodestyle Errors "W", # pycodestyle Warnings "A", # flake8-builtins - # "ANN", # flake8-annotations + "ANN", # flake8-annotations "ARG", # flake8-unused-arguments "B", # flake8-Bugbear "BLE", # flake8-blind-except @@ -61,7 +61,7 @@ select = [ "YTT", # flake8-2020 ] -ignore = [ +lint.ignore = [ "FIX002", # Allow todos (4) "D100", # Missing docstring in public module (18) "D107", # Missing docstring in `__init__` (5) @@ -69,7 +69,7 @@ ignore = [ "COM812", "ISC001" # required for `ruff format` ] -[per-file-ignores] +[lint.per-file-ignores] "__init__.py" = ["F401", "D104", "CPY001"] # module imported but unused; Missing docstring in public package "docs/*" = [ "INP001", # File * is part of an implicit namespace package. Add an `__init__.py`. @@ -82,16 +82,19 @@ ignore = [ "PLR6301", # Method * could be a function, class method, or static method ] -[pydocstyle] +[lint.pydocstyle] convention = "google" -[pylint] +[lint.pylint] max-args = 6 -[flake8-copyright] +[lint.flake8-annotations] +mypy-init-return = true + +[lint.flake8-copyright] author = "Quantinuum LLC" -[flake8-type-checking] +[lint.flake8-type-checking] quote-annotations = true [format]