From cf0079df75550104fe4fbac49a5538185b56ca6f Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Fri, 28 Oct 2022 18:45:30 +0200 Subject: [PATCH] Replace flake8 pre-commit hook with autoflake (#450) update gitlab-ci --- .gitlab-ci.yml | 4 ++-- .pre-commit-config.yaml | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f28f4210..f7a18a1f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,13 +38,13 @@ build: paths: - ${PRE_COMMIT_HOME} -flake8: +autoflake: extends: - .code_changes - .pre-commit stage: checks script: - - pre-commit run -a flake8 + - pre-commit run -a autoflake format: extends: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a5787852..e1561f06 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,7 +51,14 @@ repos: rev: 0.7.16 hooks: - id: mdformat -- repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 - hooks: - - id: flake8 +- repo: https://github.com/PyCQA/autoflake + rev: v1.7.7 + hooks: + - id: autoflake + args: + - --recursive + - --expand-star-imports + - --remove-all-unused-imports + - --remove-duplicate-keys + - --remove-unused-variables + - --in-place -- GitLab