Skip to content

stefmolin/filename-validation

Repository files navigation

Filename validation

Pre-commit hook for validating Python filenames.

Note: This hook was created for my article How to Create a Pre-Commit Hook.

Usage

Add the following to your .pre-commit-config.yaml file:

- repo: https://github.com/stefmolin/filename-validation
  rev: 0.1.1
  hooks:
    - id: validate-filename

The validate-filename hook supports custom minimum lengths with the --min-len command line argument:

- repo: https://github.com/stefmolin/filename-validation
  rev: 0.1.1
  hooks:
    - id: validate-filename
      args: [--min-len=5]

Be sure to check out the pre-commit documentation for additional configuration options.