Commit 1d28d7fd authored by Joao P C Bertoldo's avatar Joao P C Bertoldo
Browse files

Merge branch '5-git-commit-hooks'

parents c68092ae 5b9c530d
minimum_pre_commit_version: 2.12.0
python: python3.8
files: 'zUtil_Python/.+'
exclude: |
fail_fast: false
- repo:
rev: v3.4.0
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo:
rev: 20.8b1 # Replace by any tag/version:
- id: black
language_version: python3.8 # Should be a command that runs python3.6+
- repo:
rev: '3.9.0' # pick a git hash / tag to point to
- id: flake8
\ No newline at end of file
......@@ -110,3 +110,45 @@ $ python /users/user1/dct/
9. For more information or support, contact
# dev
## pre-commit hooks
[pre-commit's official website](
first, let's create an isolated environment for pre-commit
# using a conda installation that I found at `cat $(which silx)`
source /sware/isdd/packages/${os}/dau/miniconda3/etc/profile.d/
# create an empty installation of python 3.8
# src:
conda create --yes --prefix $HOME/.pre-commit-env -c conda-forge python=3.8 pre-commit
Make the pre-commit executable accessible locally:
# link the executable to your local path
ln -s ~/.pre-commit-env/bin/pre-commit ~/.local/bin/
Now check that you have pre-commit properly installed:
which pre-commit
# should be like /nana/ni/nana/na/.local/bin/pre-commit
pre-commit -V
# should be >= 2.12.0
Finally, let's activate it for the project:
cd ~/dct # or wherever you put it...
pre-commit install
line-length = 127
target-version = ['py36', 'py37', 'py38']
include = '\.pyi?$'
\ No newline at end of file
max-line-length = 127
max-complexity = 10
ignore = E203, E266, E501, W503, F403, F401
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment