Skip to main content

Random assorted pre-commit hooks

Project description

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.0
    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

madforhooks-0.4.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

madforhooks-0.4.0-py2.py3-none-any.whl (7.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file madforhooks-0.4.0.tar.gz.

File metadata

  • Download URL: madforhooks-0.4.0.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

Hashes for madforhooks-0.4.0.tar.gz
Algorithm Hash digest
SHA256 fb1cb96223e011dcb47adf83dc8c74c57b1814f9bba9f31a3e3cc44ab4acddd8
MD5 f4fdc61768f344465d8d10a24de43295
BLAKE2b-256 7fb028a7059882fa5df77be7665dbb9a0eab2f65a6d636562593d55309869217

See more details on using hashes here.

Provenance

File details

Details for the file madforhooks-0.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for madforhooks-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a696894ba848a7073c534055304ad16c4ddfd248ef8d85c64921cf77c574cb1f
MD5 436ac80861fdea30dbe83fc5412d443f
BLAKE2b-256 0b20ae57535aefe3d3c8a35ff46a4f1fa88de7300f79a060012bd0c1acec326a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page