Skip to content

Releases

Run the hooks also in the manual stage + fix --insert-license-after-regex

Choose a tag to compare

@Lucas-C Lucas-C released this 13 Jan 11:18
  • PR #103 - Fix --insert-license-after-regex to work beyond first line
  • PR #105 - Run the hooks also in the manual stage

Support for multiple license files

Choose a tag to compare

@Lucas-C Lucas-C released this 13 Feb 21:23

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

Choose a tag to compare

@Lucas-C Lucas-C released this 13 Aug 14:41

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

Choose a tag to compare

@Lucas-C Lucas-C released this 04 Aug 09:15

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

Choose a tag to compare

@Lucas-C Lucas-C released this 03 Aug 18:20

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

Choose a tag to compare

@Lucas-C Lucas-C released this 31 Mar 09:49

cf. #72

New hook: chmod + using rapidfuzz instead of fuzzywuzzy

Choose a tag to compare

@Lucas-C Lucas-C released this 31 Mar 08:35

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

Choose a tag to compare

@Lucas-C Lucas-C released this 26 Jan 09:16
v1.4.2

New release v1.4.2

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

Choose a tag to compare

@Lucas-C Lucas-C released this 22 Jan 17:58

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

Choose a tag to compare

@Lucas-C Lucas-C released this 21 Jan 13:27

Thanks to @GadgetSteve for the improvement on remove-tabs: #62