From c4628d8bcc2b9ed694f58c0ef48c94178c1916b5 Mon Sep 17 00:00:00 2001
From: Bastien Le Querrec <blq@laquadrature.net>
Date: Wed, 27 Mar 2024 11:51:36 +0100
Subject: [PATCH] =?UTF-8?q?ci:=20ajoute=20une=20v=C3=A9rification=20PEP8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .gitlab-ci.yml   | 20 ++++++++++++++++++++
 requirements.txt |  1 +
 2 files changed, 21 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5994181..c854629 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,6 +5,7 @@ variables:
 stages:
   - docker
   - install
+  - lint
   - test
 
 docker:
@@ -48,6 +49,25 @@ install:
   rules:
     - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $COMPILE_DOCKER == null
 
+pep8:
+  stage: lint
+  image: registry.git.laquadrature.net/la-quadrature-du-net/raaspotter/base:latest
+  needs: [install]
+  tags:
+    - unprivileged
+  cache:
+    key: $CI_COMMIT_REF_SLUG
+    paths:
+    - bin/
+    - lib/
+    - pyvenv.cfg
+  script:
+    - source bin/activate
+    - pycodestyle --first --show-source *.py
+  allow_failure: true
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push"
+
 .default_pref:
   stage: test
   image: registry.git.laquadrature.net/la-quadrature-du-net/raaspotter/base:latest
diff --git a/requirements.txt b/requirements.txt
index 4da0c36..4780587 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,6 +2,7 @@ beautifulsoup4>=4.12.3
 dateparser>=1.2.0
 Mastodon.py>=1.8.1
 pdfminer.six>=20231228
+pycodestyle>=2.2.0
 PyVirtualDisplay>=3.0
 requests>=2.31.0
 selenium>=4.18.1
-- 
GitLab