Skip to content
Snippets Groups Projects
Commit 7147fbe8 authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

Finally working prospector pre-commit check!!!!

To enable the pre-commit checks first run pip -Ur requierements.txt to install pre-commit. Next run pre-commit install to install the hook in your .git/hooks folder. Running pre-commit will now run prospector on all new or modified files in the backend/ directory (see pre-commit-scripts/prospector.sh for the arguments that are used). If you get an error saying prospector not found or smth. make sure you have the venvv activated or prospector installed globally.
parent e5d0f2e6
No related branches found
No related tags found
2 merge requests!15Refactor,!14Pre commit
Pipeline #
......@@ -3,6 +3,6 @@ repos:
hooks:
- id: prospector
name: prospector
entry: ./prospector.sh
language: python
files: \.py$
entry: ./pre-commit-scripts/prospector.sh
language: script
types: [python]
[MASTER]
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS, migrations, static, env, docs, manage.py
# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
ignore-patterns=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Use multiple processes to speed up Pylint.
jobs=4
# Pickle collected data for later comparisons.
persistent=yes
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages
suggestion-mode=yes
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=pylint_django
[MESSAGES CONTROL]
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
raw-checker-failed,
bad-inline-option,
locally-disabled,
locally-enabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating
[REPORTS]
# Tells whether to display a full report or only the messages
reports=yes
# Activate the evaluation score.
score=yes
[REFACTORING]
# Maximum number of nested blocks for function / method body
max-nested-blocks=5
[LOGGING]
# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules=logging
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=100
#!/bin/bash
cd backend
unset GIT_DIR
diff_files="$(git diff --cached --name-only --relative --diff-filter=AM)"
if [ -n "$diff_files" ]; then
prospector --uses django $diff_files
else
exit 0
fi
\ No newline at end of file
#!/bin/bash
cd backend
prospector --uses django
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment