From c21e73fb5e26848b43ff2cfd8dafe0c743fddb0c Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Sat, 7 May 2022 15:10:59 +0200
Subject: [PATCH] [mod] #424: Introduce flake8 pre-commit hook, conf and job

Set to 101 line length
because there is quite a lot ending at 101 chars
In .flake8, because pyproject.toml is not yet supported
---
 .flake8                 | 3 +++
 .gitlab-ci.yml          | 8 ++++++++
 .pre-commit-config.yaml | 4 ++++
 3 files changed, 15 insertions(+)
 create mode 100644 .flake8

diff --git a/.flake8 b/.flake8
new file mode 100644
index 00000000..39eea369
--- /dev/null
+++ b/.flake8
@@ -0,0 +1,3 @@
+[flake8]
+max-line-length = 101
+inline-quotes = "
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b2997ecf..60ff7111 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -38,6 +38,14 @@ build:
     paths:
       - ${PRE_COMMIT_HOME}
 
+flake8:
+  extends:
+    - .code_changes
+    - .pre-commit
+  stage: checks
+  script:
+    - pre-commit run --all-files flake8
+
 format:
   extends:
     - .code_changes
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a4b56239..fc4e10fd 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -43,3 +43,7 @@ repos:
     rev: 0.7.14
     hooks:
       - id: mdformat
+- repo: https://github.com/PyCQA/flake8
+  rev: 4.0.1
+  hooks:
+      - id: flake8
-- 
GitLab