// vim:set filetype=asciidoc:
[[quality]]
== Quality of packaging

The quality of Debian packaging can be improved by using testing tools.

* **lintian**(1)
* **piuparts**(1)
* **autopkgtest**(1)

If you follow "`<<setup>>`", these are automatically executed.  You are expected to fix all warnings.

[[wrap-and-sort]]
=== Reformat *debian/** files with *wrap-and-sort*

It is a good idea to reformat **debian/*** files consistently using the **wrap-and-sort**(1) command in **devscripts** package.

.Reformat **debian/*** files
----
[debhello-0.0] $ wrap-and-sort -vast
----

// See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895570
// This is the rationale behind -vast option

[[debputy]]
=== Validate *debian/** files with *debputy*

The new https://manpages.debian.org/unstable/dh-debputy/debputy.1.en.html[debputy] tool footnote:[The main purpose of the debputy tool is to offer a new Debian package build paradigm.  This new paradigm is beyond the scope of this tutorial.] includes subcommands to validate (and fix) most files in *debian/**.

.Check correctness of files in *debian/**
----
[debhello-0.0] $ debputy lint --spellcheck
----

.Format *debian/control* and *debian/tests/control* files
----
[debhello-0.0] $ debputy reformat --style black
----

Using the "`**debputy reformat**`" command obsoletes using "`**wrap-and-sort -vast**`".

The debputy tool also includes a language server. You can set up to get real-time feedback while editing *debian/** files with any modern editor supporting the https://en.wikipedia.org/wiki/Language_Server_Protocol[Language Server Protocol].

[[cme-fix-dpkg]]
=== Check packaging with *cme*

It is a good idea to check *dpkg* configuration files using the **cme**(1) command in **cme** package.  This is used by the https://dfsg-new-queue.debian.org/[DFSG, Licensing & New Packages Team].

.Check correctness using in *cme*
----
[debhello-0.0] $ cme fix --verbose dpkg
----

// FTP NEW cue uses this test
