compliance/reuse@v1
Hygiene checks for repositories that follow the FSFE REUSE
Specification (https://reuse.software/) — every licensable
file declares its license + copyright via an SPDX header (or
a .license companion / REUSE.toml entry), and the full
license texts live under LICENSES/.
Adopt with:
extends: - alint://bundled/compliance/reuse@v1 This ruleset has no fact gate — extending it is the user's
signal that they intend to be REUSE-compliant. If you need
narrower coverage, override paths: on the SPDX-header rule
(e.g. limit to one source tree) or level: off rules you
don't want.
What it checks
Section titled "What it checks"3 rules. Each links to its section below, which explains the check and shows its definition.
| Rule | Reports |
|---|---|
reuse-licenses-dir-existserror | REUSE-compliant projects need a LICENSES/ directory containing the full text of each license referenced by SPDX-License-Identifier: headers (named e.g. LICENSES/Apache-2.0.txt). |
reuse-source-has-spdx-identifierwarning | REUSE: every source file should declare its license with an SPDX-License-Identifier: header in the first few lines (in a comment). |
reuse-source-has-copyright-textwarning | REUSE: every source file should declare its copyright with an SPDX-FileCopyrightText: <year> <holder> header alongside the SPDX-License-Identifier. |
reuse-licenses-dir-exists
Section titled "reuse-licenses-dir-exists"The REUSE spec mandates a top-level LICENSES/ directory containing the full text of every license used in the project (named by SPDX identifier, e.g. LICENSES/MIT.txt). reuse lint rejects a project without it, and so does this rule.
- kind:
dir_exists - level:
error - policy: https://reuse.software/spec/#license-files
REUSE-compliant projects need a
LICENSES/directory containing the full text of each license referenced bySPDX-License-Identifier:headers (named e.g.LICENSES/Apache-2.0.txt). Runreuse download --allto populate it from the SPDX corpus.
- id: reuse-licenses-dir-exists kind: dir_exists paths: "LICENSES" level: error message: >- REUSE-compliant projects need a `LICENSES/` directory containing the full text of each license referenced by `SPDX-License-Identifier:` headers (named e.g. `LICENSES/Apache-2.0.txt`). Run `reuse download --all` to populate it from the SPDX corpus. policy_url: "https://reuse.software/spec/#license-files" reuse-source-has-spdx-identifier
Section titled "reuse-source-has-spdx-identifier"Every common-source-extension file should carry an SPDX-License-Identifier header in its first ~10 lines. Files that license-via-companion (*.license) or via REUSE.toml mappings legitimately lack inline headers — narrow paths: to your source trees if your project uses those mechanisms heavily.
- kind:
file_header - level:
warning - policy: https://reuse.software/spec/#comment-headers
REUSE: every source file should declare its license with an
SPDX-License-Identifier:header in the first few lines (in a comment). Use a.licensecompanion file or aREUSE.tomlmapping if the file format can't carry comments.
- id: reuse-source-has-spdx-identifier kind: file_header paths: include: ["**/*.{rs,py,js,jsx,ts,tsx,go,java,kt,c,cc,cpp,h,hpp,hh,sh,rb,swift}" ] exclude: - "**/vendor/**" - "**/node_modules/**" - "**/target/**" - "**/build/**" - "**/dist/**" - "**/.cargo/**" lines: 10 pattern: "SPDX-License-Identifier:" level: warning message: >- REUSE: every source file should declare its license with an `SPDX-License-Identifier:` header in the first few lines (in a comment). Use a `.license` companion file or a `REUSE.toml` mapping if the file format can't carry comments. policy_url: "https://reuse.software/spec/#comment-headers" reuse-source-has-copyright-text
Section titled "reuse-source-has-copyright-text"Every common-source-extension file should also carry a SPDX FileCopyrightText header naming the copyright holder. Required by the REUSE spec alongside SPDX-License-Identifier:.
- kind:
file_header - level:
warning - policy: https://reuse.software/spec/#format
REUSE: every source file should declare its copyright with an
SPDX-FileCopyrightText: <year> <holder>header alongside the SPDX-License-Identifier.
- id: reuse-source-has-copyright-text kind: file_header paths: include: ["**/*.{rs,py,js,jsx,ts,tsx,go,java,kt,c,cc,cpp,h,hpp,hh,sh,rb,swift}" ] exclude: - "**/vendor/**" - "**/node_modules/**" - "**/target/**" - "**/build/**" - "**/dist/**" - "**/.cargo/**" lines: 10 pattern: "SPDX-FileCopyrightText:" level: warning message: >- REUSE: every source file should declare its copyright with an `SPDX-FileCopyrightText: <year> <holder>` header alongside the SPDX-License-Identifier. policy_url: "https://reuse.software/spec/#format" Customize
Section titled "Customize"Every rule here can be overridden by id from your own .alint.yml: change its level, or set level: off to drop it. An id that doesn't exist is an error at config load, so a typo can't silently pass.
extends: - alint://bundled/compliance/reuse@v1 rules: - id: reuse-licenses-dir-exists level: off - id: reuse-source-has-spdx-identifier level: errorTo take only part of the ruleset, filter it where you extend it with only: or except::
extends: - url: alint://bundled/compliance/reuse@v1 except: [reuse-licenses-dir-exists]Bundled rulesets covers versioning and how rulesets combine.
Source
Section titled "Source"The full ruleset definition, comments included, is committed at crates/alint-dsl/rulesets/v1/compliance/reuse.yml in the alint repo.