tripleo-common/.pre-commit-config.yaml
Sorin Sbarnea 13ac87ba36 Enable pylint
This is a follow-up from [1] which underlined that the code lacks even basic coverage as it allow
us to introduce a costly regression which could have being detected by pylint no-member test.

- enables pylint with most checks temporary disabled, so we have time
  to address them gradually
- fixes few minor issues reported by the tool
- adds skips for some known "no-member" errors but avoids adding it to the exclude list, as this
  in order to prevent further regressions.
- once landed we can easily address the temporary disabled errors, one by one. In fact this is could
  prove as a very good learning experience for newer team members. They can start by removing on
  random exclusion and fixing it. As a hint: leave the missing docstrings for the end, some problems
  are more important to fix first.

1: https://review.opendev.org/c/openstack/tripleo-common/+/762892/6/tripleo_common/image/builder/buildah.py

Change-Id: I10ab0cbfbaab77b9208e9a5d74d59eb041cb16ee
2020-12-21 14:06:49 +00:00

34 lines
1.1 KiB
YAML

---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.8.4
hooks:
- id: flake8
- repo: https://github.com/openstack-dev/bashate.git
rev: 2.0.0
hooks:
- id: bashate
entry: bashate --error . --ignore=E006,E040,E042
# Run bashate check for all bash scripts
# Ignores the following rules:
# E006: Line longer than 79 columns (as many scripts use jinja
# templating, this is very difficult)
# E040: Syntax error determined using `bash -n` (as many scripts
# use jinja templating, this will often fail and the syntax
# error will be discovered in execution anyway)
- repo: https://github.com/PyCQA/pylint
rev: pylint-2.6.0
hooks:
- id: pylint