lichenn 1.2.0

Manage and generate the licenses of your project effectively and mighty quick, with a smooth interface, custom rules and configuration
Documentation
# Configuration for Lichen, a tool for managing licenses
# This file allows you to specify global settings and per-license configurations.

# ▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰ #
# Global Configuration #
# ▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰ #

# When applying license headers to files, prefer using block comments if the
# file type supports them. If set to false, line comments are preferred.
# If a preferred comment style is not available for a file type, the other
# style will be used as a fallback.
# Possible values: true, false
# Default: Not set, behavior depends on application logic (likely line comments)
# prefer_block = true

# Controls the behavior when multiple licenses are configured to apply to
# the same file.
# - true: Conflicting licenses will be merged into a single header (if possible)
#   or the last specified license will replace previous ones. Warnings may be
#   issued.
# - false: The incoming license will overrite the existing.
# Default: false
# multiple = true

# A list of regular expressions. Any file path that matches *any* of these
# regular expressions will be excluded from license header application,
# regardless of any per-license 'targets' configuration. This is useful for
# excluding common ignore patterns or specific files/directories globally.
# Examples:
# - "\\.gitignore": Excludes all .gitignore files.
# - ".*lock": Excludes files ending with "lock" (e.g., Cargo.lock).
# - "\\.git/.*": Excludes everything inside the .git directory.
# - "README.*": Excludes files starting with "README".
# - ".*\\.(md|rst|txt)": Excludes common documentation files.
# Default: Empty list.
exclude = [
  "\\.gitignore",
  ".*lock",
  "\\.git/.*",
  "\\.licensure\\.yml",
  "README.*",
  "LICENSE.*",
  ".*\\.(md|rst|txt)",
  "Cargo.toml",
  ".*\\.github/.*",
]

# If set to true, ignore entries found in .gitignore files or exlclude patterns when determining
# which files to process. Files listed in .gitignore will be processed if
# they are not otherwise excluded by the global or per-license 'exclude'
# rules, or included by per-license 'targets'.
# If set to false (the default behavior), files ignored by .gitignore and exclude patterns will
# also be ignored by Lichen.
# Possible values: true, false
# Default: false
# all = true

# ▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰ #
# Per-License Configuration #
# ▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰ #

# [[license]] blocks define configurations for specific licenses.
# Each block specifies which files a license should apply to,
# the license identifier, and optional author information.

[[license]]
# A regular expression. Files matching this regex will be excluded *for this
# specific license*, even if they are included by the 'targets' for this
# license. This provides fine-grained exclusion control within a license block.
# Example: exclude = "tests/.*" # Excludes files in the tests directory for this license
# Default: No exclusion for this license.
# exclude = "some/pattern/to/exclude"

# A list of file paths or directory paths. This license will only be
# considered for files found within these paths. If left empty, this license
# can potentially apply to any file not excluded globally or by the license's
# 'exclude' pattern.
# Paths can be relative to the configuration file or absolute.
# Examples:
# targets = ["src/", "tests/main.rs"]
# targets = ["/path/to/specific/directory"]
# Default: Current directory
targets = ["."]

# The SPDX identifier for the license. This is a mandatory field.
# Refer to the SPDX License List for valid identifiers:
# https://spdx.org/licenses/
id = "MIT"

# The date to use in the license header. If not provided, the current year
# will likely be used by default by the application logic.
# Format: "YYYY-MM-DD"
# Example: date = "2023-10-27"
# Default: Not set, Uses the current year.
# date = "2023-10-27"

# A list of authors to include in the license header. Each author can have a
# name and an optional email address.
# If left empty, no author information will be included for this license header,
# unless the license text itself hardcodes it.
# Default: Empty list of authors.
authors = [
  { name = "Core Contributor", email = "core@example.com" },
  { name = "Another Contributor" }, # Email is optional
]

# You can add more [[license]] blocks for other licenses and their respective
# configurations.

# [[license]]
# targets = ["src/cli/"]
# id = "Apache-2.0"
# authors = [
#   { name = "CLI Developer" }
# ]

# [[license]]
# targets = ["examples/"]
# id = "GPL-3.0-or-later"
# date = "2024-01-01"