Random assorted pre-commit hooks
Project description
MadForHooks
Random assorted pre-commit hooks.
Usage
Put this in the repos section of your .pre-commit-config.yaml file:
- repo: https://github.com/MarcoGorelli/madforhooks
rev: 0.4.1
hooks:
- id: conda-env-sorter
- id: no-print-statements
- id: check-execution-order
- id: check-test-naming
Or, from the commandline:
pip install madforhooks
python -m madforhooks.check_execution_order file1.ipynb file2.ipynb file3.ipynb
Example of how to run check-test-naming on your test directory:
git ls-files | xargs python -m madforhooks.check_test_naming
Hooks available
conda-env-sorter
Sort the dependencies in your conda environment file(s).
no-print-statements
Raise if print statements are found (unless they have file=).
check-execution-order
Raise if notebook cells were executed out-of-order. Use --strict to ensure
strict monotonicity.
check-test-naming
Check that test names start with test. This is useful for finding
tests which are meant to be running in CI, but which don't because they
are misnamed.
If there are any false positives, you prevent this tool from flagging them
by adding a # not a test comment one the line where the function/class is
defined.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file madforhooks-0.4.1.tar.gz.
File metadata
- Download URL: madforhooks-0.4.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13bf4b820789353bcdca9f36a9f7ca93cfb0f0312ad063fc3aa56b78c7dc3c0a
|
|
| MD5 |
dd367e311e3494d7584d46e1c1d6a71c
|
|
| BLAKE2b-256 |
0a533e7dc5320c8e130d03eaf8705ae4eca646e1432ebf50ab6af9f0109ff849
|
File details
Details for the file madforhooks-0.4.1-py2.py3-none-any.whl.
File metadata
- Download URL: madforhooks-0.4.1-py2.py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02ccf844008544ff41d5b623a4d74e0a504d2b35e25404ca06fd6d72473f6c0f
|
|
| MD5 |
c5285f042e62c0423a71dc46d8050477
|
|
| BLAKE2b-256 |
dde26d2eeb2852705350e17df298b68e0ed9f9fd5398cf1f56bf7fea35cf9dcd
|