Skip to content

Releases: Lucas-C/pre-commit-hooks

Support for multiple license files

13 Feb 21:23
Compare
Choose a tag to compare

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.

Preserve line endings when editing file in insert_license hook

13 Aug 14:41
Compare
Choose a tag to compare

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

insert_license: new --allow-past-years parameter allows stale years to be left unchanged

04 Aug 09:15
Compare
Choose a tag to compare

⚠️ ⚠️ 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

Renamed chmod hook to pre_commit_chmod to avoid conflict with standard chmod command

03 Aug 18:20
Compare
Choose a tag to compare

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

Using pre-commit built-in text files detection feature

31 Mar 09:49
Compare
Choose a tag to compare

New hook: chmod + using rapidfuzz instead of fuzzywuzzy

31 Mar 08:35
Compare
Choose a tag to compare

Usage

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

insert-license: bugfixes for --use-current-year optional flag

26 Jan 09:16
Compare
Choose a tag to compare

insert-license: new --use-current-year optional flag

22 Jan 17:58
Compare
Choose a tag to compare

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.

remove-tabs alignment now considers the enclosing whitespaces + ensured support for Python 3.11

21 Jan 13:27
Compare
Choose a tag to compare

Supporting Python 3.10+

16 Aug 09:02
Compare
Choose a tag to compare

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