Skip to main content

Build Status codecov pre-commit.ci status

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.

Release files for madforhooks 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for madforhooks 0.4.1
File Size Uploaded
madforhooks-0.4.1.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for madforhooks 0.4.1
File Interpreter ABI Platform
madforhooks-0.4.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 13.6 kB

Release files / madforhooks-0.4.1.tar.gz

Download URL madforhooks-0.4.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
13bf4b820789353bcdca9f36a9f7ca93cfb0f0312ad063fc3aa56b78c7dc3c0a
BLAKE2b-256 checksum
How to use checksums
0a533e7dc5320c8e130d03eaf8705ae4eca646e1432ebf50ab6af9f0109ff849
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.15

Release files / madforhooks-0.4.1-py2.py3-none-any.whl

Download URL madforhooks-0.4.1-py2.py3-none-any.whl
Size 7.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
02ccf844008544ff41d5b623a4d74e0a504d2b35e25404ca06fd6d72473f6c0f
BLAKE2b-256 checksum
How to use checksums
dde26d2eeb2852705350e17df298b68e0ed9f9fd5398cf1f56bf7fea35cf9dcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.15

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page