lintian-brush

This package contains a set of scripts to automatically fix some common issues in Debian packages.

Running lintian-brush

Simply run::

shell lintian-brush

in the top-level of your (version controlled) Debian package.

.. _supported-tags:

Supported tags

The current set of lintian tags for which a fixer is available that can fix a subset of the issues:

.. _writing-fixers:

Writing new fixers

For a more extensive write-up, see the guide on writing fixers.

Ideally, fixers target a particular set of lintian tags. This is not strictly required, but makes it possible to easily find all packages that a particular fixer can be used on.

Each fixer is a simple script that lives under fixers. Scripts should be registered in the index.desc file in the same directory.

A fixer is run in the root directory of a package, where it can make changes it deems necessary. If a fixer can not provide any improvements, it can simply leave the working tree untouched - lintian-brush will not create any commits for it or update the changelog. If exits with a non-zero return code, whatever changes it has made will be discarded and the fixer will be reported as having failed.

The following additional environment variables are set:

For fixer written in python, the lintian_brush.fixer module can be used for convenient access to these variables.

A fixer should write a short description of the changes it has made to standard out; this will be used for the commit message.

It can include optional metadata in its output::

The default minimum certainty level is "certain"; any incorrect change made with certainty "certain" is considered at least a normal-severity bug.

The easiest way to test fixers is to create a skeleton in and out source tree under tests/FIXER-NAME/TEST-NAME. The in directory should contain the tree to run the fixer on, and out contains the directory after it has run. It's fine to create directories with only one or two control files, if the fixer only needs those. To run the tests for a single fixer, you can use "make check-fixer-$NAME".

GitHub Action

If you're hosting a Git repository on GitHub, you can use the lintian-brush GitHub action to automatically run lintian-brush.