[damned-lies] chore: add prospector for static analysis



commit 6930efd459659068ceb0bf5977de9d642a4f22c1
Author: Guillaume Bernard <associations guillaume-bernard fr>
Date:   Sat Apr 17 20:16:51 2021 +0200

    chore: add prospector for static analysis

 .gitlab-ci.yml  | 15 +++++++++++++++
 .prospector.yml | 27 +++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0a4b415a..3320148b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,3 +29,18 @@ test:
     - when: always
       allow_failure: false
 
+linter:
+  script:
+    - pip install prospector[with_bandit]
+    - prospector
+  rules:
+    # When job is triggered after a push event, run only when code files changed
+    - if: $CI_PIPELINE_SOURCE == "push"
+      changes:
+        - po/*  # po files are committed by l10n itself
+        - docs/*
+        - "*.md"
+      when: manual
+    # Otherwise, always run job.
+    - when: always
+      allow_failure: true
diff --git a/.prospector.yml b/.prospector.yml
new file mode 100644
index 00000000..3610a686
--- /dev/null
+++ b/.prospector.yml
@@ -0,0 +1,27 @@
+inherits:
+    - default
+    - strictness_high
+    - full_pep8
+
+output-format: grouped
+test-warnings: false
+
+max-line-length: 119
+
+ignore-paths:
+  - docs
+
+pylint:
+  disable:
+    - unused-argument
+    - line-tool-long
+    # The two elements below are under discussion and should be removed if possible.
+    - arguments-differ
+    - signature-differs
+
+pep8:
+  disable:
+    - E501  # line too long
+
+bandit:
+  run: true


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]