Help for developers

Licensing should be easy for developers. We provide several tools and services to allow you to concentrate on coding.

Contents: Helper tool, example repositories, REUSE API, CI/CD workflows

Helper Tool

The REUSE helper tool assists with achieving and confirming REUSE compliance. It downloads the full license texts, adds copyright and license information to file headers, and contains a linter to identify problems. Eventually, you can generate a software bill of materials.

Read the documentation to learn more about the tool. You will also find a tool section in our FAQ for the most pressing questions.

Example repositories

What does a REUSE-compliant project look like? The following repositories are basic, but each of them is REUSE-compliant. We make them available to demonstrate how REUSE works in practice.

Consider registering your project with the REUSE API to include a dynamic compliance badge.

API

The REUSE API helps you to continuously check and display compliance with the REUSE guidelines. You can include a badge indicating the live status in your README file, and parse the output using the generated JSON file.

This is how the badge will look like for a REUSE compliant project. You can click on the badge to see more information: REUSE status

The API is the perfect tool for everyone who wants to show that their repository follows best practices in providing licensing and copyright information. It allows third-party services to integrate the live REUSE status, and offers a simple alternative for people who do not want to install the REUSE helper tool for a first quick check.

As everything else in REUSE, the API is publicly available under Free Software licenses.

Pre-commit hook

You can automatically run reuse lint on every commit as a pre-commit hook for Git. This uses pre-commit. Once you have it installed, add this to the .pre-commit-config.yaml in your repository:

repos:
-   repo: https://github.com/fsfe/reuse-tool
    rev: latest
    hooks:
    - id: reuse

Then run pre-commit install. Now, every time you commit, reuse lint is run in the background, and will prevent your commit from going through if there was an error.

Inclusion in CI/CD workflows

REUSE can be easily integrated into your existing CI/CD processes to continuously test your repository and its changes for REUSE compliance.

The FSFE offers a Docker image which can be used in numerous CI solutions. Find a few examples below:

Drone

Include the following snippet in your .drone.yml file:

steps:
- name: reuse
  image: fsfe/reuse:latest

More information about Drone on drone.io.

GitHub

GitHub users can integrate the REUSE action in their workflow. Visit the action’s marketplace page for usage instructions.

More information about GitHub Actions on help.github.com.

GitLab

Include the following snippet in your .gitlab-ci.yml file:

reuse:
  image:
    name: fsfe/reuse:latest
    entrypoint: [""]
  script:
    - reuse lint

More information about GitLab’s CI on docs.gitlab.com.

Travis CI

Include the following snippet in your .travis.yml file:

language: minimal

services:
  - docker

before_install:
- docker pull fsfe/reuse:latest
- docker run -v ${TRAVIS_BUILD_DIR}:/data fsfe/reuse:latest lint

More information on Travis CI on travis-ci.com.