From 53783809e14ac46abaa7a2bcb41721042a802039 Mon Sep 17 00:00:00 2001 From: inimaz Date: Wed, 11 Feb 2026 19:04:49 +0100 Subject: [PATCH] chore: update pre-commit to run autoflake first --- .pre-commit-config.yaml | 19 ++++++++++++------- carbonserver/initial_data.py | 5 ----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f59f64443..0037266fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,15 @@ repos: + - repo: https://github.com/PyCQA/autoflake + rev: v2.3.1 + hooks: + - id: autoflake + args: + [ + --in-place, + --remove-unused-variables, + --remove-all-unused-imports, + --expand-star-imports, + ] - repo: https://github.com/pycqa/isort rev: 7.0.0 hooks: @@ -14,10 +25,4 @@ repos: hooks: - id: flake8 args: ["--config=.flake8"] - additional_dependencies: ['flake8-bugbear==23.9.16'] - - # removes unused imports and unused variables - - repo: https://github.com/PyCQA/autoflake - rev: v2.3.1 - hooks: - - id: autoflake \ No newline at end of file + additional_dependencies: ['flake8-bugbear==23.9.16'] \ No newline at end of file diff --git a/carbonserver/initial_data.py b/carbonserver/initial_data.py index 48203d47e..e4d90b0b3 100644 --- a/carbonserver/initial_data.py +++ b/carbonserver/initial_data.py @@ -37,11 +37,6 @@ def check_initial_data(db): def shell(db): if settings.environment not in ("develop", "local"): raise Exception("This script must be run in develop environment") - from carbonserver.api.infra.database.sql_models import ( - Membership as SqlModelMembership, - ) - from carbonserver.api.infra.database.sql_models import Project as SqlModelProject - from carbonserver.api.infra.database.sql_models import User as SqlModelUser logger.info("Checking initial data...") with db.session() as session: