6

retenmod/.pre-commit-config.yaml at main · apwheele/retenmod · GitHub

 2 years ago
source link: https://github.com/apwheele/retenmod/blob/main/.pre-commit-config.yaml
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

main

retenmod/.pre-commit-config.yaml

Go to file

79 lines (70 sloc) 1.9 KB

repos:

# black code formatter - repo: https://github.com/ambv/black rev: 21.10b0 hooks: - id: black args: # arguments to configure black - --line-length=88

# language should be local language_version: python3.6

# flake8 pep checks - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.3.0 hooks: - id: flake8 args: # arguments to configure flake8 - "--max-line-length=88" # These folders will be excluded - "--exclude=build,dist,*__init__.py" # Sometimes flake and black have conflicts # E203 whitespace before : # W503 line break before binary operator - "--ignore=E203,W503"

# pytest check - repo: local hooks: - id: pytest-check name: pytest-check entry: pytest language: system pass_filenames: false always_run: true

# redoing the readme - repo: local hooks: - id: gen-readme name: gen-readme entry: jupyter nbconvert --execute --to markdown README.ipynb language: system pass_filenames: false always_run: true

# This does not work # As it always modifies the files (notebooks have timestamps) # running the example notebook #- repo: local # hooks: # - id: notebook-analysis # name: notebook-analysis # entry: jupyter nbconvert --to notebook --inplace --execute ExampleAnalysis.ipynb # language: system # pass_filenames: false # always_run: true # To get this to work would need some crazy diff stuff going on

# USE NOTES # # To set up run # # pre-commit install # # and then you can do your normal git add + git commit # or run # # pre-commit run --all-files # # if you edit this yaml, need to rerun install # # Help to build this taken from # https://rednafi.github.io/digressions/python/2020/04/06/python-precommit.html # https://github.com/pre-commit/pre-commit/issues/761#issuecomment-394167542 # https://stackoverflow.com/a/59499550/604456


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK