Skip to content

Commit

Permalink
README.md update
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-C committed Feb 13, 2024
1 parent f305bcf commit ad5eff0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ this issue: [#83](https://github.com/Lucas-C/pre-commit-hooks/issues/83)
- [Handling years flexibly](#handling-years-flexibly)
- [No extra EOL](#no-extra-eol)
- [Fuzzy license matching](#fuzzy-license-matching)
- [Multiple license files](#multiple-license-files)
- [Handy shell functions](#handy-shell-functions)
- [Useful local hooks](#useful-local-hooks)
- [Forbid / remove some unicode characters](#forbid--remove-some-unicode-characters)
Expand Down Expand Up @@ -168,6 +169,17 @@ License insertion can be skipped altogether if the file contains the
`SKIP LICENSE INSERTION` in the first X top lines. This can also be
overridden by `--skip-license-insertion-comment=<COMMENT>` flag.

#### 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.


## Handy shell functions

```shell
Expand Down
2 changes: 1 addition & 1 deletion pre_commit_hooks/insert_license.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def get_license_info_list(args) -> list[LicenseInfo]:
return license_info_list


def process_files(
def process_files( # pylint: disable=too-many-branches
args,
changed_files: list[str],
todo_files: list[str],
Expand Down

0 comments on commit ad5eff0

Please sign in to comment.