From 2f4ef3ba6a04eac96db5e46bf4741f5c4bd4af17 Mon Sep 17 00:00:00 2001
From: Merwane Hamadi <merwanehamadi@gmail.com>
Date: Mon, 17 Apr 2023 12:49:56 -0700
Subject: [PATCH] Update pre-commit hooks with isort, black, and local
 pytest-check

---
 .flake8                 | 10 +++++-----
 .pre-commit-config.yaml | 35 ++++++++++++++---------------------
 2 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/.flake8 b/.flake8
index c456b3932..779762248 100644
--- a/.flake8
+++ b/.flake8
@@ -1,12 +1,12 @@
 [flake8]
 max-line-length = 88
-extend-ignore = E203
+select = "E303, W293, W291, W292, E305, E231, E302"
 exclude =
     .tox,
     __pycache__,
     *.pyc,
     .env
-    venv/*
-    .venv/*
-    reports/*
-    dist/*
\ No newline at end of file
+    venv*/*,
+    .venv/*,
+    reports/*,
+    dist/*,
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index dd1d0ec92..3722b25ee 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,39 +1,32 @@
 repos:
-  - repo: https://github.com/sourcery-ai/sourcery
-    rev: v1.1.0 # Get the latest tag from https://github.com/sourcery-ai/sourcery/tags
-    hooks:
-      - id: sourcery
-
   - repo: https://github.com/pre-commit/pre-commit-hooks
     rev: v0.9.2
     hooks:
       - id: check-added-large-files
-        args: [ '--maxkb=500' ]
+        args: ['--maxkb=500']
       - id: check-byte-order-marker
       - id: check-case-conflict
       - id: check-merge-conflict
       - id: check-symlinks
       - id: debug-statements
-    
-  - repo: local
+
+  - repo: https://github.com/pycqa/isort
+    rev: 5.12.0
     hooks:
       - id: isort
-        name: isort-local
-        entry: isort
-        language: python
-        types: [ python ]
-        exclude: .+/(dist|.venv|venv|build)/.+
-        pass_filenames: true
+        language_version: python3.10
+
+  - repo: https://github.com/psf/black
+    rev: 23.3.0
+    hooks:
       - id: black
-        name: black-local
-        entry: black
-        language: python
-        types: [ python ]
-        exclude: .+/(dist|.venv|venv|build)/.+
-        pass_filenames: true
+        language_version: python3.10
+
+  - repo: local
+    hooks:
       - id: pytest-check
         name: pytest-check
         entry: pytest --cov=autogpt --without-integration --without-slow-integration
         language: system
         pass_filenames: false
-        always_run: true
\ No newline at end of file
+        always_run: true