[![Build Status](https://github.com/MarcoGorelli/madforhooks/workflows/tox/badge.svg)](https://github.com/MarcoGorelli/madforhooks/actions?workflow=tox)
[![codecov](https://codecov.io/gh/MarcoGorelli/madforhooks/branch/main/graph/badge.svg?token=KrZeKo2xwD)](https://codecov.io/gh/MarcoGorelli/madforhooks)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/MarcoGorelli/madforhooks/main.svg)](https://results.pre-commit.ci/latest/github/MarcoGorelli/madforhooks/main)
# MadForHooks
Random assorted [pre-commit](https://github.com/pre-commit/pre-commit) hooks.
## Usage
Put this in the `repos` section of your `.pre-commit-config.yaml` file:
```yaml
- 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:
```console
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:
```console
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/MarcoGorelli/madforhooks",
"name": "madforhooks",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7.0",
"maintainer_email": "",
"keywords": "conda,pre-commit",
"author": "Marco Gorelli",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/0a/53/3e7dc5320c8e130d03eaf8705ae4eca646e1432ebf50ab6af9f0109ff849/madforhooks-0.4.1.tar.gz",
"platform": null,
"description": "[![Build Status](https://github.com/MarcoGorelli/madforhooks/workflows/tox/badge.svg)](https://github.com/MarcoGorelli/madforhooks/actions?workflow=tox)\n[![codecov](https://codecov.io/gh/MarcoGorelli/madforhooks/branch/main/graph/badge.svg?token=KrZeKo2xwD)](https://codecov.io/gh/MarcoGorelli/madforhooks)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/MarcoGorelli/madforhooks/main.svg)](https://results.pre-commit.ci/latest/github/MarcoGorelli/madforhooks/main)\n\n# MadForHooks\n\nRandom assorted [pre-commit](https://github.com/pre-commit/pre-commit) hooks.\n\n## Usage\n\nPut this in the `repos` section of your `.pre-commit-config.yaml` file:\n\n```yaml\n- repo: https://github.com/MarcoGorelli/madforhooks\n rev: 0.4.1\n hooks:\n - id: conda-env-sorter\n - id: no-print-statements\n - id: check-execution-order\n - id: check-test-naming\n```\n\nOr, from the commandline:\n\n```console\npip install madforhooks\npython -m madforhooks.check_execution_order file1.ipynb file2.ipynb file3.ipynb\n```\n\nExample of how to run ``check-test-naming`` on your test directory:\n```console\ngit ls-files | xargs python -m madforhooks.check_test_naming\n```\n\n## Hooks available\n\n### conda-env-sorter\n\nSort the dependencies in your conda environment file(s).\n\n### no-print-statements\n\nRaise if print statements are found (unless they have `file=`).\n\n### check-execution-order\n\nRaise if notebook cells were executed out-of-order. Use `--strict` to ensure\nstrict monotonicity.\n\n### check-test-naming\n\nCheck that test names start with `test`. This is useful for finding\ntests which are meant to be running in CI, but which don't because they\nare misnamed.\n\nIf there are any false positives, you prevent this tool from flagging them\nby adding a `# not a test` comment one the line where the function/class is\ndefined.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Random assorted pre-commit hooks",
"version": "0.4.1",
"split_keywords": [
"conda",
"pre-commit"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "c5285f042e62c0423a71dc46d8050477",
"sha256": "02ccf844008544ff41d5b623a4d74e0a504d2b35e25404ca06fd6d72473f6c0f"
},
"downloads": -1,
"filename": "madforhooks-0.4.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "c5285f042e62c0423a71dc46d8050477",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7.0",
"size": 7434,
"upload_time": "2022-12-24T14:49:41",
"upload_time_iso_8601": "2022-12-24T14:49:41.047926Z",
"url": "https://files.pythonhosted.org/packages/dd/e2/6d2eeb2852705350e17df298b68e0ed9f9fd5398cf1f56bf7fea35cf9dcd/madforhooks-0.4.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "dd367e311e3494d7584d46e1c1d6a71c",
"sha256": "13bf4b820789353bcdca9f36a9f7ca93cfb0f0312ad063fc3aa56b78c7dc3c0a"
},
"downloads": -1,
"filename": "madforhooks-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "dd367e311e3494d7584d46e1c1d6a71c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.0",
"size": 6127,
"upload_time": "2022-12-24T14:49:42",
"upload_time_iso_8601": "2022-12-24T14:49:42.469661Z",
"url": "https://files.pythonhosted.org/packages/0a/53/3e7dc5320c8e130d03eaf8705ae4eca646e1432ebf50ab6af9f0109ff849/madforhooks-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-24 14:49:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "MarcoGorelli",
"github_project": "madforhooks",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "madforhooks"
}