Skip to content

Commit 1fc7578

Browse files
authored
README.md update (#99)
1 parent f305bcf commit 1fc7578

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ this issue: [#83](https://github.com/Lucas-C/pre-commit-hooks/issues/83)
1919
- [Handling years flexibly](#handling-years-flexibly)
2020
- [No extra EOL](#no-extra-eol)
2121
- [Fuzzy license matching](#fuzzy-license-matching)
22+
- [Multiple license files](#multiple-license-files)
2223
- [Handy shell functions](#handy-shell-functions)
2324
- [Useful local hooks](#useful-local-hooks)
2425
- [Forbid / remove some unicode characters](#forbid--remove-some-unicode-characters)
@@ -168,6 +169,23 @@ License insertion can be skipped altogether if the file contains the
168169
`SKIP LICENSE INSERTION` in the first X top lines. This can also be
169170
overridden by `--skip-license-insertion-comment=<COMMENT>` flag.
170171

172+
#### Multiple license files
173+
174+
If more than one `--license-filepath` argument is specified, the checks are
175+
performed as follows:
176+
177+
1. First, an exact match is pursued, checking the 1st license file, then
178+
the 2nd, and so on. If a match is found, the normal behavior is
179+
followed, as if the matched license file was the only license file
180+
specified.
181+
182+
2. If no exact match is found, then the software resorts to fuzzy matching.
183+
Again, as soon as a match is found, the normal behavior is followed, as
184+
if the fuzzy-matched license file was the only license file specified.
185+
186+
3. Finally, if neither exact nor fuzzy matches are found, the content of
187+
the first license file is inserted.
188+
171189
## Handy shell functions
172190

173191
```shell

pre_commit_hooks/insert_license.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def get_license_info_list(args) -> list[LicenseInfo]:
194194
return license_info_list
195195

196196

197-
def process_files(
197+
def process_files( # pylint: disable=too-many-branches
198198
args,
199199
changed_files: list[str],
200200
todo_files: list[str],

0 commit comments

Comments
 (0)