From 7ef81e9038f5ae874fd4723f92d5ebabafd99fb2 Mon Sep 17 00:00:00 2001 From: ankur prabhu Date: Mon, 30 Oct 2023 06:54:52 +0000 Subject: [PATCH 1/2] using ruff --- .pre-commit-config.yaml | 15 ++++++++------- pyproject.toml | 9 +++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 80f0e2970b..a9cf040caf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,14 +2,14 @@ default_language_version: python: python3 repos: - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.3 hooks: - - id: isort - - repo: https://github.com/psf/black - rev: 23.3.0 - hooks: - - id: black + - id: ruff + args: + - --fix + - id: ruff-format + - repo: https://github.com/pycqa/flake8 rev: 6.0.0 hooks: @@ -18,3 +18,4 @@ repos: - --exclude=.+/migrations/ - --max-line-length=88 - --ignore=E501,W503,E203 + diff --git a/pyproject.toml b/pyproject.toml index 765870bc2f..f968924a77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,3 +13,12 @@ max-line-length = 88 [tool.isort] profile = "black" + +[tool.ruff] +select = [ + # isort + "I001" +] +line-length = 88 + + From b99cfcf9913b8cab53508bc9c557b4c7033c98f7 Mon Sep 17 00:00:00 2001 From: ankur prabhu Date: Tue, 31 Oct 2023 20:07:59 +0000 Subject: [PATCH 2/2] removing existing pre-commit --- .pre-commit-config.yaml | 9 +-------- pyproject.toml | 21 +++------------------ requirements.dev.txt | 6 +----- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9cf040caf..afe99f0eb8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,12 +10,5 @@ repos: - --fix - id: ruff-format - - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 - hooks: - - id: flake8 - args: - - --exclude=.+/migrations/ - - --max-line-length=88 - - --ignore=E501,W503,E203 + diff --git a/pyproject.toml b/pyproject.toml index f968924a77..7c24a35477 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,24 +1,9 @@ -[tool.black] -line-length = 88 -target-version = ['py311'] -include = '\.pyi?$' # all files that end with .py or .pyi - -[tool.pylint.master] -load-plugins = 'pylint_django' -django-settings-module = 'ownphotos.settings' -disable = 'E029,C0111,C0301' - -[tool.pylint.format] -max-line-length = 88 - -[tool.isort] -profile = "black" - [tool.ruff] select = [ - # isort - "I001" + "I001", + "YTT", ] +exclude = ["migrations"] line-length = 88 diff --git a/requirements.dev.txt b/requirements.dev.txt index 6ca790dd92..9b25efe20c 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -4,14 +4,10 @@ ipython-genutils==0.2.0 Pygments==2.15.0 prompt-toolkit==3.0.38 nose==1.3.7 -pylint==2.17.2 -pylint-django==2.5.3 -flake8==6.0.0 pre-commit==2.14.0 coverage==7.1.0 Faker==17.6.0 -isort==5.12.0 setuptools==67.6.1 -black==23.3.0 pyfakefs==5.2.0 pytest==7.3.1 +ruff==0.1.3