README.md 3.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
lintian-brush
=============

This package contains a set of scripts to automatically fix some common issues in
Debian packages, as reported by Lintian.

Running lintian-brush
---------------------

Simply run::

```shell
lintian-brush
```

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

18 19
.. _supported-tags:

20 21 22 23 24 25 26 27 28
Supported tags
--------------

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

* ancient-python-version-field
* control-file-with-CRLF-EOLs
* copyright-has-crs
29
* debhelper-but-no-misc-depends
30 31
* debian-control-has-empty-field
* debian-control-has-obsolete-dbg-package
32
* debian-pyversions-is-obsolete
33 34 35
* debian-rules-should-not-use-pwd
* debian-upstream-obsolete-path
* debian-watch-uses-insecure-uri
36
* dh-quilt-addon-but-quilt-source-format
37 38 39 40 41 42
* dm-upload-allowed-is-obsolete
* file-contains-trailing-whitespace
* homepage-field-uses-insecure-uri
* insecure-copyright-format-uri
* malformed-dm-upload-allowed
* missing-debian-source-format
43
* missing-vcs-browser-field
44
* out-of-date-copyright-format-uri
45 46
* package-needs-versioned-debhelper-build-depends
* package-uses-deprecated-debhelper-compat-version
47
* package-uses-deprecated-source-override-location
48
* package-uses-old-debhelper-compat-version
49
* priority-extra-is-replaced-by-priority-optional
Jelmer Vernooij's avatar
Jelmer Vernooij committed
50
* public-upstream-key-not-minimal
51
* quilt-series-without-trailing-newline
52
* systemd-service-file-pidfile-refers-to-var-run
53
* transitional-package-should-be-oldlibs-optional
Jelmer Vernooij's avatar
Jelmer Vernooij committed
54
* unnecessary-team-upload
55
* unnecessary-testsuite-autopkgtest-field
56
* unversioned-copyright-format-uri
57
* useless-autoreconf-build-depends
58 59 60 61 62 63 64
* vcs-field-uses-insecure-uri
* vcs-field-uses-not-recommended-uri-format
* wrong-debian-qa-group-name
* xc-package-type-in-debian-control
* xs-testsuite-field-in-debian-control
* xs-vcs-field-in-debian-control

65 66
.. _writing-fixers:

67 68 69
Writing new fixers
------------------

70 71
Each fixer is a simple script that lives under ``fixers``. Scripts should
be registered in the ``index.desc`` file in the same directory.
72 73 74 75 76 77 78 79

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.

A fixer should write a short description of the changes it has made to standard
out; this will be used for the commit message.
80 81 82 83 84 85 86 87

It can include optional metadata in its output::

 * ``Fixes-Lintian-Tags:`` followed by a comma-separated list of lintian tags
   that it claims to have fixed. This will make lintian-brush include
   links to documentation about the fixed lintian tags. In the future,
   it may also support building the package to verify the lintian tag
   is actually resolved.
88 89 90 91

 * ``Certainty:`` followed by ``certain`` or ``possible``,
   indicating how certain the fixer is that the fix was the right
   one.
92 93 94 95 96 97

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.