LICENSECHECK(1p)

πŸŽ€ LICENSECHECK πŸŽ€

okay bestie, so this is the manual page for LICENSECHECK(1p), and it lives in the User Contributed Perl Documentation section of the man pages. It's literally the cutest little detective that sniffs out which license applies to your source files. no cap. let's get into it πŸ’…


✨ NAME ✨

licensecheck β€” simple license checker for source files


πŸ’– VERSION πŸ’–

Version v3.3.9 β€” yes we're on v3.3.9, she's thriving πŸ¦‹


🌈 SYNOPSIS 🌈

licensecheck [ --help | --version ]

licensecheck [ --list-licenses | --list-naming-schemes ]

licensecheck [OPTION...] PATH [PATH...]

three whole modes, three whole moods. pick your fighter ⭐


🧚 DESCRIPTION 🧚

so basically licensecheck tries to figure out which license applies to each file you hand it. how? she goes snooping at the start of the file, searching for text that belongs to all the various licenses. it's giving forensic investigator but make it ✨legal✨.

if any of the arguments you pass are directories, licensecheck will scoop up the files contained inside them and add those to the list of files to process. she's thorough like that 🫢

and when you pass multiple PATHs? then only files that match --check and don't match --ignore actually get checked. rules are rules bestie πŸ’€


πŸ‘‘ OPTIONS πŸ‘‘

πŸ” Resolving patterns

  • --shortname-scheme β€” Since v3.2. a comma-separated priority list of license naming schemes to use for license identifiers. (default value: unset (which means use the verbose description instead))
  • --list-licenses β€” Since v3.2. lists the identifiers for all the detectable licenses and then exits. window shopping but for license names ✨
  • --list-naming-schemes β€” Since v3.2. lists all the available license naming schemes and exits. so many aesthetics to choose from πŸ’…

πŸ—‚οΈ Selecting files

  • -c REGEX, --check=REGEX β€” Since v2.10.10. a regular expression of the files to include when more than one PATH is provided. (default value: common source files)
  • -i REGEX, --ignore=REGEX β€” Since v2.10.10. a regular expression of the files to skip when more than one PATH is provided. (default value: some backup and VCS files β€” the messy ones, respectfully)
  • -r, --recursive β€” Since v2.10.7. traverses directories recursively. she goes deeper. she goes ALL the way down. periodt 🌸

πŸ“– Parsing contents

  • -l N, --lines=N β€” Since v2.10.3. the number of lines to parse from the top of each file. heads up: this implies an optimistic search that includes only the first cluster of detected copyrights or licenses. set it to 0 to parse the whole file (and in that case, ignore --tail). (default value: 60)
  • --tail=N β€” Since v2.15.10. the number of bytes to parse from the bottom of each file β€” and this only kicks in when you're parsing from the top only and found nothing up there. set to 0 to avoid parsing from the end of the file at all (or set --lines to 0 and this setting gets ignored entirely). (default value: 5000 (roughly 60 lines))
  • -e CODEC, --encoding=CODEC β€” Since v2.15.10. try to decode the source files from the specified CODEC, with "iso-8859-1" as the fallback. (default value: unset (no decoding at all))

πŸ“Š Reporting results

  • --copyright β€” Since v2.10.7. adds the copyright statements to the license information. receipts included πŸ’…
  • -s, --skipped β€” Since v3.3.0. logs files in PATHs that match neither --check nor --ignore as warnings (by default they get logged as debug instead).
  • -m, --machine β€” Since v2.12.2. prints the license information as "TAB"-separated fields, so you can feed it to line-oriented tools like "awk" and "sort". very much the "let the machines handle it" vibe πŸ€–
  • --[no-]deb-machine β€” Since v3.0.0. prints the license information like a Debian copyright file. this implies --copyright and --shortname-scheme=debian,spdx.
  • --list-delimiter=PRINTF β€” Since v3.0.18. a printf-string used between multiple plain list items in the Debian copyright file. (default value: '\n ' (NEWLINE SPACE))
  • --rfc822-delimiter=PRINTF β€” Since v3.0.18. a printf-string used between multiple RFC822-style items in the Debian copyright file. (default value: '\n ' (NEWLINE SPACE SPACE))
  • --copyright-delimiter=PRINTF β€” Since v3.0.19. a printf-string used between years and owners in the Debian copyright file. (default value: ', ' (COMMA SPACE))
  • --[no-]merge-licenses β€” Since v3.0.0. merges same-licensed files in the Debian copyright file. group them, they're a unit 🫢

🌟 General

  • -h, --help β€” prints the help message and exits. the classic πŸŽ€
  • -v, --version β€” prints version and copyright information and exits.
  • --quiet, --verbose, --debug, --trace β€” Since v3.3.0. emit only error messages to STDERR (with option --quiet), or β€” in addition to errors and warnings β€” also notices/debug/traces. the more "noisy" option wins if several of them are set. (default: emit errors and warnings)

πŸ¦‹ ENVIRONMENT πŸ¦‹

  • NO_COLOR β€” if defined, it will disable color. it gets consulted before COLOR. she asked first, respect the order bestie πŸ’…
  • COLOR β€” can be set to 0 to explicitly disable colors. the default is to use color when connected to a terminal. if you're in a terminal, you get the ✨aesthetic✨.
  • LOG_LEVEL / QUIET / VERBOSE / DEBUG / TRACE β€” these are used to emit varying details about discoveries to STDERR when verbosity is not set using any of the options --quiet, --verbose, --debug or --trace. see Log::Any::Adapter::Screen for more details. πŸ‘€
  • LOG_PREFIX β€” the default formatter groks these variables. see formatter in Log::Any::Adapter::Screen for more details.

😭 CAVEATS 😭

the exact output may change between releases β€” and that's because scanning unstructured data is inherently fragile, plus detection patterns keep getting improved. it's giving "we're working on it". if you want some level of stability, use one of the machine-readable output formats and define a --shortname-scheme. fr fr, protect your pipeline 🫢

also: option --deb-fmt was deprecated since v3.2. please use option --shortname-scheme=debian,spdx instead. she's retired, let her rest πŸ’€


🌸 SEE ALSO 🌸

other similar tools exist. obviously. the girlies stay competing πŸ’…

here is a list of known tools that are also command-line based and general-purpose:


πŸ’œ AUTHOR πŸ’œ

Jonas Smedegaard "<dr@jones.dk>"


this program is based on the script "licensecheck" from the KDE SDK, originally introduced by Stefan Westerfeld "<stefan@space.twc.de>". shoutout to the originators 🫢

Copyright Β© 2007, 2008 Adam D. Barratt

Copyright Β© 2012 Francesco Poli

Copyright Β© 2016-2022 Jonas Smedegaard

Copyright Β© 2017-2022 Purism SPC

this program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU Affero General Public License for more details.

you should have received a copy of the GNU Affero General Public License along with this program. if not, see <https://www.gnu.org/licenses/>.


okay that's the whole page bestie, you ate it πŸ’… this was LICENSECHECK(1p) as documented for perl v5.36.0, dated 2023-08-28 β€” go forth and license-check everything, mwah πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from