Fixed makefile, dependencies and pre-commit hooks.

This commit is contained in:
Franco Masotti 2020-10-18 13:06:48 +02:00
parent 9a72e9ccfe
commit 76b566b6fa
Signed by: frnmst
GPG Key ID: 24116ED85666780A
3 changed files with 49 additions and 17 deletions

35
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,35 @@
# 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: v2.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pre-commit/mirrors-yapf
rev: 'v0.30.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.8.3' # Use the sha / tag you want to point at
hooks:
- id: flake8
args: ['--ignore=E501,W503,W504']
additional_dependencies: [flake8-docstrings]
- repo: https://github.com/PyCQA/bandit
rev: '1.6.2' # 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.1.5'
hooks:
- id: skjold
args: ['-s', 'gemnasium', '-s', 'pyup']

View File

@ -20,26 +20,22 @@
# along with fattura-elettronica-reader. If not, see <http://www.gnu.org/licenses/>.
#
default: pep doc test
export PACKAGE_NAME=fattura_elettronica_reader
githook:
git config core.hooksPath .githooks
pep:
pipenv run yapf --style '{based_on_style: pep8; indent_width: 4}' -i fattura_elettronica_reader/*.py tests/*.py
pipenv run flake8 --ignore=F401,E501 fattura_elettronica_reader/*.py tests/*.py
default: doc
doc:
pipenv run $(MAKE) -C docs html
install:
pip install .
pip3 install . --user
uninstall:
pip uninstall fattura_elettronica_reader
pip3 uninstall $(PACKAGE_NAME)
install-dev:
pipenv install
pipenv install --dev
pipenv run pre-commit install
uninstall-dev:
pipenv --rm
@ -59,4 +55,4 @@ clean:
rm -rf build dist *.egg-info
pipenv run $(MAKE) -C docs clean
.PHONY: default pep doc install install-dev test uninstall uninstall-dev dist upload clean
.PHONY: default doc install uninstall install-dev uninstall-dev test clean

13
Pipfile
View File

@ -4,19 +4,20 @@ url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
# Documentation.
Sphinx = "==3.2.1"
sphinx-rtd-theme = '==0.5.0'
# Tools.
twine = "==3.2.0"
pre-commit = "==2.7.1"
[packages]
requests = "==2.24.0"
lxml = "==4.5.2"
flake8 = "==3.8.3"
flake8-docstrings = "==1.5.0"
yapf = "==0.30.0"
sphinx-rtd-theme = "==0.5.0"
twine = "==3.2.0"
atomicwrites = "==1.4.0"
filetype = "==1.0.7"
appdirs = "==1.4.4"
Sphinx = "==3.1.2"
[requires]
python_version = "3.8"