diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8635fd94aaf9fd3367908f394ff005fb73af28f6..b2f4c009357ff738a45f0edd40bdd00f00fb1899 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] diff --git a/backend/.pylintrc b/backend/.pylintrc deleted file mode 100644 index dc0fdb2dc4da190c837ce47ca197e7bd4ffe95ab..0000000000000000000000000000000000000000 --- a/backend/.pylintrc +++ /dev/null @@ -1,143 +0,0 @@ -[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 diff --git a/pre-commit-scripts/prospector.sh b/pre-commit-scripts/prospector.sh new file mode 100755 index 0000000000000000000000000000000000000000..dd41b303bcb966282958a05885d2e9344ba84eb4 --- /dev/null +++ b/pre-commit-scripts/prospector.sh @@ -0,0 +1,11 @@ +#!/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 diff --git a/prospector.sh b/prospector.sh deleted file mode 100755 index 4cf682634cd8dfc0206149e5a1285f7211835e14..0000000000000000000000000000000000000000 --- a/prospector.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd backend -prospector --uses django \ No newline at end of file