Skip to main content

mondeja's pre-commit hooks

PyPI Python versions License Tests

Example configuration

- repo: https://github.com/mondeja/pre-commit-hooks
  rev: v1.5.0
  hooks:
    - id: dev-extras-required
    - id: root-editorconfig-required
    - id: cloudflare-nameservers
      args:
        - -domain=my-web.xyz
    - id: cloudflare-gh-pages-dns
      args:
        - -domain=my-web.xyz
        - -username=my_gh_username

Hooks

add-pre-commit-hook

Add a pre-commit hook to your configuration file if is not already defined.

Parameters

  • -repo=URL (str) Repository of the new hook.
  • -rev=VERSION (str) Version of the new hook.
  • -hook=ID (str) Identifier of the new hook.

dev-extras-required

Check if your development dependencies contains all other extras requirements. If an extra requirement is defined in other extra group than your development one, it will be added to your development extra dependencies group. If your development group is not defined, it will be created.

This is useful if you want to execute python -m pip install -e .[dev] to install all the optional requirements of the package, so if you add a new requirement to another groups, it will be added to development requirements.

Parameters

  • -extra=NAME (str): Name for your development requirements extra group (as default dev).
  • -setup-cfg=PATH (str): Path to your setup.cfg file, mandatory if the extras requirements are defined in a setup.cfg file and this is located in another directory than the current one.
  • -pyproject-toml=PATH (str): Path to your pyproject.toml file, mandatory if the extras requirements are defined in a pyproject.toml file and this is located in another directory than the current one.

nameservers-endswith

Check that the nameservers of a domain ends with a string or raise an error. You can use it to check if a site like Clouflare is managing a domain using -nameserver=cloudflare.com.

Parameters

  • -domain=DOMAIN (str): Domain name whose nameservers will be checked.
  • -nameserver=NAMESERVER (str): String to end the domain name servers in.

cloudflare-nameservers

Check that Cloudflare is handling the nameservers of a domain.

Parameters

  • -domain=DOMAIN (str): Domain name whose nameservers will be checked.

cloudflare-gh-pages-dns

Check that the DNS records of a Cloudflare site are configured to serve a static website under Github Pages.

You must define the environment variable CF_API_KEY with your Cloudflare API key.

The required DNS records to make it pass are:

Type Name Content
A {domain} 185.199.108.153
A {domain} 185.199.109.153
A {domain} 185.199.110.153
A {domain} 185.199.111.153
CNAME www {username}.github.io

Parameters

  • -domain=DOMAIN: Domain managed by Cloudflare whose DNS records will be checked.
  • -username=USER: Github username or organization under the Github Pages site is being served.

Environment variables

freenom-autorenew

Renews your free Freenom domains.

You must set the environment variables FREENOM_EMAIL and FREENOM_PASSWORD to give permissions to this hook for entering in your Freenom account.

Parameters

  • -domain=DOMAIN: Domain to renew. This parameter is optional, if you don't specify it, the hook will renew all of the free domains registered in your account.
  • -period=DOMAIN: Period for the new renovation time. This parameter is optional, if you don't specify it the time will be one year (12M).

Environment variables

  • FREENOM_EMAIL: Email of your Freenom account.
  • FREENOM_PASSWORD: Password of your Freenom account.

root-editorconfig-required

Check if your repository has an .editorconfig file and if this has a root directive defined as true before section headers.

wavelint

Check if your WAVE files have the correct number of channels, frame rate, durations...

Parameters

  • -nchannels=N (int): Number of channels that your sounds must have.
  • -sample-width=N (int): Number of bytes that your sounds must have.
  • -frame-rate=N (int): Sampling frequency that your sounds must have.
  • -nframes=N (int): Exact number of frames that your sounds must have.
  • -comptype=TYPE (str): Compression type that your sounds must have.
  • -compname=NAME (int): Compression that your sounds must have.
  • -min-duration=TIME (float): Minimum duration in seconds that your sounds must have.
  • -max-duration=TIME (float): Maximum duration in seconds that your sounds must have.

More hooks

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mondeja_pre_commit_hooks-1.5.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mondeja_pre_commit_hooks-1.5.0-py2.py3-none-any.whl (17.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mondeja_pre_commit_hooks-1.5.0.tar.gz.

File metadata

  • Download URL: mondeja_pre_commit_hooks-1.5.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for mondeja_pre_commit_hooks-1.5.0.tar.gz
Algorithm Hash digest
SHA256 c72e866b19f053e110637cd1fef51e37c4b1f4584feb95c5272e43899e62c1c3
MD5 631dd52ea6aed32cab11cd3559c9af17
BLAKE2b-256 d953046eda8dbdf61d0d9872ab156d825296df089fbcca35f19c06f68a56d036

See more details on using hashes here.

File details

Details for the file mondeja_pre_commit_hooks-1.5.0-py2.py3-none-any.whl.

File metadata

  • Download URL: mondeja_pre_commit_hooks-1.5.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for mondeja_pre_commit_hooks-1.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 28b22f3f7db73609385635d353ca9d9a37de08e5fdb6b952ac3ecf7229870e89
MD5 dca057b3821277026ba4b1adf9fc5ed6
BLAKE2b-256 0b020c97cdf64323c1c0cdd0eeb7e7aa5fc51bfc6ffe95d4e0c69c22bead13bb

See more details on using hashes here.

Release history Release notifications | RSS feed

1.8.0

2 files

1.7.0

2 files

1.6.0

2 files

1.5.2

2 files

1.5.1

2 files

This release

1.5.0 This release

2 files

1.4.0

2 files

1.3.0

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 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