AlbanAndrieu/nabla-servers-bower

View on GitHub
.pre-commit-config.yaml

Summary

Maintainability
Test Coverage
---
#  default_language_version:
#    python: python3.6  # Ubuntu 18.04.3
#    python: python3.7  # Ubuntu 19.04

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks.git
    # pre-commit-hooks is not working on both environment
    # You will have to switch
    # pre-commit-hooks.git from v2.1.0 to v2.4.0
    #    rev: v2.1.0 # ok python3.6  # 18.04.3
    #    rev: v2.2.3 # ok python3.6  # 19.04 but failing on 18.04.3
    rev: v4.1.0 # ok python3.6 on Ubuntu 18.04 AND python3.7 on Ubuntu 19.04
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-added-large-files
        args: ["--maxkb=123"]
        exclude: >
          (?x)^(
              .pnp.cjs|
              package-lock.json|
              npm-shrinkwrap.json
          )$
      - id: check-case-conflict
      - id: check-docstring-first
      - id: check-executables-have-shebangs
        exclude: >
          (?x)^(
              clean.bat|
              build.bat|
              mvnw.cmd|
              .mvn/.*
          )$
      - id: check-json
        exclude: ^.vscode/
      - id: check-xml
      - id: check-yaml
        exclude: >
          (?x)^(
              packs/.*|
              k8s/.*|
          )$
      - id: check-symlinks
      - id: check-merge-conflict
      - id: debug-statements
      - id: detect-private-key
        exclude: >
          (?x)^(
              roles/jenkins-master/defaults/main.yml|
              roles/jenkins-master/README.md|
              ca.key|
              server.key
          )$
      - id: double-quote-string-fixer
      - id: name-tests-test
        exclude: >
          (?x)^(
              .*/molecule/default/tests/test_default.py
          )$
#      - id: no-commit-to-branch
#        args: [--branch, develop, --branch, master, --branch, release/*]
      - id: end-of-file-fixer
      - id: fix-encoding-pragma
      - id: requirements-txt-fixer
      - id: sort-simple-yaml
      - id: file-contents-sorter
  - repo: https://github.com/pre-commit/pre-commit.git
    rev: v2.16.0
    hooks:
      - id: validate_manifest
  - repo: https://github.com/asottile/reorder_python_imports.git
    rev: v2.6.0
    hooks:
      - id: reorder-python-imports
    #       language_version: python3
    #       language_version: python2.7
  - repo: https://github.com/asottile/add-trailing-comma
    rev: v2.2.1
    hooks:
      - id: add-trailing-comma
  - repo: https://github.com/willthames/ansible-lint.git
    rev: v5.3.2
    hooks:
      - id: ansible-lint
        files: \.(yaml|yml)$
        exclude: >
          (?x)^(
              .travis.yml|
              packs/.*|
              k8s/.*|
          )$
  - repo: https://github.com/doublify/pre-commit-hindent.git
    rev: b3680b6ebf9f7cf29b19307f246adef66756feef
    hooks:
      - id: hindent
  - repo: https://github.com/detailyang/pre-commit-shell
    rev: 1.0.5
    hooks:
      - id: shell-lint
        #entry: pre_commit_hooks/shell-lint.sh -x
        args: [-x]
        exclude: >
          (?x)^(
              mvnw|
              hooks|
          )$
  - repo: https://github.com/asottile/pyupgrade
    rev: v2.31.0
    hooks:
      - id: pyupgrade
  - repo: https://github.com/pre-commit/mirrors-autopep8
    rev: v1.6.0
    hooks:
      - id: autopep8
  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.9.2
    hooks:
      - id: flake8
        args: [--max-line-length=120]
    #-   repo: https://github.com/PyCQA/bandit
    #    rev: master
    #    hooks:
    #    - id: bandit
  - repo: https://github.com/IamTheFij/ansible-pre-commit
    rev: v0.1.2
    hooks:
      - id: encryption-check
  - repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
    rev: v1.1.1
    hooks:
      - id: htmllint
        args: [--config, .htmlhintrc]
      - id: markdown-toc
        args: [--maxdepth, "3", -i]
      - id: dockerfile_lint
        #args: [--json, --verbose, --dockerfile]
        args:
          [--permissive, --verbose, --dockerfile, ./docker/ubuntu18/Dockerfile]
    #-   repo: https://github.com/psf/black
    #    rev: 20.8b1
    #    hooks:
    #      - id: black
    #        args: [--line-length=78]
    files: ^src/
  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v0.931
    hooks:
      - id: mypy
        exclude: ^(docs/|example-plugin/|tests/fixtures)
  #-   repo: https://github.com/Agilicus/pre-commit-hook-k8svalidate.git
  #    rev: v0.0.8
  #    hooks:
  #      - id: k8svalidate
  #        args: [--kubernetes-version, 1.17.14, --exclude, '**/*.patch.yaml']
  #        files: .yaml$
  - repo: https://github.com/gruntwork-io/pre-commit
    rev: v0.1.17
    hooks:
      - id: helmlint
  - repo: https://github.com/norwoodj/helm-docs
    rev: v1.6.0
    hooks:
      - id: helm-docs
        args:
          # Make the tool search for charts only under the `packs/helm-sample/charts` directory
          - --chart-search-root=packs/helm-sample/charts
        files: (README\.md\.gotmpl|(Chart|requirements|values)\.yaml)$
  - repo: https://github.com/AlbanAndrieu/nabla-hooks.git
    rev: v1.0.3
    hooks:
      - id: git-branches-check
        always_run: true
        args: [--max=3]
        verbose: true