Lucas C Pre Commit Hooks Versions Save

git pre-commit hooks

v1.5.5

3 months ago

Added

+ Update multiple licence year ends in one run

+ Multiple license files

If more than one --license-filepath argument is specified, the checks are performed as follows:

  1. First, an exact match is pursued, checking the 1st license file, then the 2nd, and so on. If a match is found, the normal behavior is followed, as if the matched license file was the only license file specified.

  2. If no exact match is found, then the software resorts to fuzzy matching. Again, as soon as a match is found, the normal behavior is followed, as if the fuzzy-matched license file was the only license file specified.

  3. Finally, if neither exact nor fuzzy matches are found, the content of the first license file is inserted.

v1.5.4

9 months ago

Changed

  • preserve line endings when editing file in insert_license hook -cf. #84
  • the chmod hook does nothing under Windows

⚠️ ⚠️ This hook, since v1.5.2, requires pre-commit 3.2.0 or superior. If you get an error like Expected one of ... but got: 'pre-commit', check this issue: #83

v1.5.3

9 months ago

⚠️ ⚠️ This hook, since v1.5.2, requires pre-commit 3.2.0 or superior. If you get an error like Expected one of ... but got: 'pre-commit', check this issue: #83

v1.5.2

9 months ago

Also confined formatting-related hooks to meaningful stages - cf. PR #75

Now this hook requires pre-commit 3.2.0 or superior. If you get an error like Expected one of ... but got: 'pre-commit', check this issue: #83

v1.5.0

1 year ago

Usage

- repo: https://github.com/Lucas-C/pre-commit-hooks
  rev: v1.5.0
  hooks:
    - id: chmod
      args: ['644']
      files: \.md$

v1.4.2

1 year ago

v1.4.1

1 year ago

Handling years flexibly

You can add --use-current-year to change how the hook treats years in the headers:

  • When inserting a header, the current year will always be inserted regardless of the year listed in the license file.
  • When modifying a file that already has a header, the hook will ensure the current year is listed in the header by using a range. For instance, 2015 or 2015-2018 would get updated to 2015-2023 in the year 2023.
  • When removing headers, the licenses will be removed regardless of the years they contain -- as if they used the year currently present in the license file.

v1.4.0

1 year ago

Thanks to @GadgetSteve for the improvement on remove-tabs: https://github.com/Lucas-C/pre-commit-hooks/pull/62

v1.3.1

1 year ago

Supporting Python 3.10 by using python-Levenshtein package instead of python-Levenshtein-wheels