Browse Source

Added hooks.

master
Franco Masotti 1 year ago
parent
commit
c62abf3378
Signed by: frnmst
GPG Key ID: 24116ED85666780A
  1. 13
      .allowed_licenses.yml
  2. 3
      .gitignore
  3. 69
      .pre-commit-config.yaml
  4. 11
      .pre-commit-hooks.yaml

13
.allowed_licenses.yml

@ -0,0 +1,13 @@
allowed licenses:
- OSI Approved::BSD License
- OSI Approved::Apache Software License
- OSI Approved::MIT License
- OSI Approved::GNU General Public License v3 or later (GPLv3+)
files to check:
- Pipfile
- setup.py
language: python
include: []

3
.gitignore vendored

@ -1,6 +1,5 @@
Pipfile.lock
*.yml
*.yaml
!.allowed_licenses.yml
# Byte-compiled / optimized / DLL files
__pycache__/

69
.pre-commit-config.yaml

@ -0,0 +1,69 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: destroyed-symlinks
- id: detect-private-key
- id: check-ast
- id: check-case-conflict
- id: debug-statements
- repo: https://github.com/pre-commit/mirrors-yapf
rev: 'v0.31.0' # Use the sha / tag you want to point at
hooks:
- id: yapf
args: ['--style', '{based_on_style: pep8; indent_width: 4}']
- repo: https://gitlab.com/pycqa/flake8
rev: '3.9.1' # Use the sha / tag you want to point at
hooks:
- id: flake8
args: ['--ignore=E501,W503,W504,F401']
additional_dependencies: [flake8-docstrings]
- repo: https://github.com/PyCQA/bandit
rev: '1.7.0' # Use the sha / tag you want to point at
hooks:
- id: bandit
args: ['--skip', 'B404,B506,B410,B603', '--level', 'LOW']
- repo: https://github.com/twu/skjold
rev: 'v0.2.1'
hooks:
- id: skjold
args: ['-s', 'gemnasium', '-s', 'pyup']
- repo: https://github.com/pycqa/isort
rev: 5.5.2
hooks:
- id: isort
- repo: local
hooks:
- id: unit-tests
name: unit tests
language: system
entry: make test
verbose: true
always_run: true
pass_filenames: false
- id: build-docs
name: build docs
language: system
entry: make doc
verbose: true
always_run: true
pass_filenames: false
- id: licheck
name: build docs
language: python
entry: licheck .allowed_licenses.yml
verbose: true
always_run: true
pass_filenames: false

11
.pre-commit-hooks.yaml

@ -0,0 +1,11 @@
---
# Define plugins (hooks) provided by this repo.
# How to test: https://pre-commit.com/#developing-hooks-interactively
- id: licheck
name: Check dependencies licenses
description: 'Replace TOC marker with a table of contents'
language: python
types: [python] # as detected by pre-commit with identify-cli
entry: licheck
args: ['.allowed_licenses.yml']
Loading…
Cancel
Save