summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml45
-rw-r--r--README.md4
-rw-r--r--src/debputy/lsp/lsp_debian_control_reference_data.py239
-rw-r--r--src/debputy/plugin/debputy/private_api.py2
4 files changed, 128 insertions, 162 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2a61c06..1543f14 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,10 +1,20 @@
+# TODO: Figure out if we can reuse these jobs but run them after our own checks without having
+# to manually merge `stages`.
+include:
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
+
+
stages:
+ - ci-test
+ - pages
+ - provisioning
+ - build
+ - publish
- test
- - deploy
- - Salsa-CI
tests-testing:
- stage: test
+ stage: ci-test
image: debian:testing
script:
- apt-get update
@@ -12,7 +22,7 @@ tests-testing:
- dpkg-buildpackage -us -uc -tc
tests-unstable:
- stage: test
+ stage: ci-test
image: debian:unstable
script:
- apt-get update
@@ -20,7 +30,7 @@ tests-unstable:
- dpkg-buildpackage -Ppkg.debputy.ci -us -uc -tc
tests-unstable-without-optional-bd:
- stage: test
+ stage: ci-test
image: debian:unstable
script:
- apt-get update
@@ -28,7 +38,7 @@ tests-unstable-without-optional-bd:
- dpkg-buildpackage -Ppkg.debputy.minimal-tests -us -uc -tc
tests-unstable-coverage:
- stage: test
+ stage: ci-test
image: debian:unstable
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
script:
@@ -49,7 +59,7 @@ tests-unstable-coverage:
path: coverage.xml
pages:
- stage: deploy
+ stage: pages
script:
- mkdir public
- mv htmlcov public/
@@ -61,9 +71,18 @@ pages:
only:
- main
-# Once all tests have passed, also run the Debian build and packaging quality
-# assurance
-build_deb:
- stage: Salsa-CI
- trigger:
- include: debian/salsa-ci.yml
+variables:
+ SALSA_CI_DISABLE_WRAP_AND_SORT: 0
+ SALSA_CI_WRAP_AND_SORT_ARGS: '-abkt'
+ SALSA_CI_AUTOPKGTEST_ALLOWED_EXIT_STATUS: 0
+ SALSA_CI_DISABLE_APTLY: 0
+
+debputy-lint:
+ stage: ci-test
+ image: debian:sid-slim
+ script:
+ - apt-get update -qq && apt-get -qq install --no-install-recommends --yes dh-debputy python3-pygls
+ - PERL5LIB=lib debputy lint --spellcheck
+ except:
+ variables:
+ - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
diff --git a/README.md b/README.md
index df92605..3940f2c 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,7 @@ do it.
The following communication channels are available:
- * Using the https://salsa.debian.org/debian/debputy features, such as issues. Generally, these
+ * Using the <https://salsa.debian.org/debian/debputy> features, such as issues. Generally, these
will be available to the public. While confidential issues can be filed, please note that
all Debian Developers can read it.
* Filing bugs via `reportbug debputy` to Debian's Bug Tracking System. Note all such bugs will have
@@ -87,5 +87,5 @@ has the relevant skill set, policies, and infrastructure to handle this. While t
salsa.debian.org services provides support for **confidential** issues, all Debian Developers
can read those for the `debputy` project. This makes it unsuitable for security bugs under embargo.
-Please review https://www.debian.org/security/faq#contact for how to contact the Debian Security
+Please review <https://www.debian.org/security/faq#contact> for how to contact the Debian Security
Team.
diff --git a/src/debputy/lsp/lsp_debian_control_reference_data.py b/src/debputy/lsp/lsp_debian_control_reference_data.py
index feed858..4237d64 100644
--- a/src/debputy/lsp/lsp_debian_control_reference_data.py
+++ b/src/debputy/lsp/lsp_debian_control_reference_data.py
@@ -223,6 +223,61 @@ ALL_SECTIONS = _allowed_values(
]
)
+ALL_PRIORITIES = _allowed_values(
+ Keyword(
+ "required",
+ hover_text=textwrap.dedent(
+ """\
+ The package is necessary for the proper functioning of the system (read: dpkg needs it).
+
+ Applicable if dpkg *needs* this package to function and it is not a library.
+
+ No two packages that both have a priority of *standard* or higher may conflict with
+ each other.
+ """
+ ),
+ ),
+ Keyword(
+ "important",
+ hover_text=textwrap.dedent(
+ """\
+ The *important* packages are a bare minimum of commonly-expected and necessary tools.
+
+ Applicable if 99% of all users in the distribution needs this package and it is not a library.
+
+ No two packages that both have a priority of *standard* or higher may conflict with
+ each other.
+ """
+ ),
+ ),
+ Keyword(
+ "standard",
+ hover_text=textwrap.dedent(
+ """\
+ These packages provide a reasonable small but not too limited character-mode system. This is
+ what will be installed by default (by the debian-installer) if the user does not select anything
+ else. This does not include many large applications.
+
+ Applicable if your distribution installer will install this package by default on a new system
+ and it is not a library.
+
+ No two packages that both have a priority of *standard* or higher may conflict with
+ each other.
+ """
+ ),
+ ),
+ Keyword(
+ "optional",
+ hover_text="This is the default priority and used by the majority of all packages"
+ " in the Debian archive",
+ ),
+ Keyword(
+ "extra",
+ is_obsolete=True,
+ replaced_by="optional",
+ hover_text="Obsolete alias of `optional`.",
+ ),
+)
def all_architectures_and_wildcards(arch2table) -> Iterable[Union[str, Keyword]]:
wildcards = set()
@@ -674,7 +729,7 @@ SOURCE_FIELDS = _fields(
"""\
Declares the name of the source package.
- Note this must match the name in the first entry of debian/changelog file.
+ Note this must match the name in the first entry of `debian/changelog` file.
"""
),
),
@@ -686,7 +741,7 @@ SOURCE_FIELDS = _fields(
"""\
Declares the last semantic version of the Debian Policy this package as last checked against.
- **Example*:
+ **Example**:
```
Standards-Version: 4.5.2
```
@@ -705,12 +760,12 @@ SOURCE_FIELDS = _fields(
"""\
Define the default section for packages in this source package.
- Example:
+ **Example**:
```
Section: devel
```
- Please see https://packages.debian.org/unstable for more details about the sections.
+ Please see <https://packages.debian.org/unstable> for more details about the sections.
"""
),
),
@@ -719,73 +774,19 @@ SOURCE_FIELDS = _fields(
FieldValueClass.SINGLE_VALUE,
default_value="optional",
warn_if_default=False,
- known_values=_allowed_values(
- Keyword(
- "required",
- hover_text=textwrap.dedent(
- """\
- The package is necessary for the proper functioning of the system (read: dpkg needs it).
-
- Applicable if dpkg *needs* this package to function and it is not a library.
-
- No two packages that both have a priority of *standard* or higher may conflict with
- each other.
- """
- ),
- ),
- Keyword(
- "important",
- hover_text=textwrap.dedent(
- """\
- The *important* packages are a bare minimum of commonly-expected and necessary tools.
-
- Applicable if 99% of all users in the distribution needs this package and it is not a library.
-
- No two packages that both have a priority of *standard* or higher may conflict with
- each other.
- """
- ),
- ),
- Keyword(
- "standard",
- hover_text=textwrap.dedent(
- """\
- These packages provide a reasonable small but not too limited character-mode system. This is
- what will be installed by default (by the debian-installer) if the user does not select anything
- else. This does not include many large applications.
-
- Applicable if your distribution installer will install this package by default on a new system
- and it is not a library.
-
- No two packages that both have a priority of *standard* or higher may conflict with
- each other.
- """
- ),
- ),
- Keyword(
- "optional",
- hover_text="This is the default priority and used by the majority of all packages"
- " in the Debian archive",
- ),
- Keyword(
- "extra",
- is_obsolete=True,
- replaced_by="optional",
- hover_text="Obsolete alias of `optional`.",
- ),
- ),
+ known_values=ALL_PRIORITIES,
hover_text=textwrap.dedent(
"""\
Define the default priority for packages in this source package.
The priority field describes how important the package is for the functionality of the system.
- Example:
+ **Example**:
```
Priority: optional
```
- Unless you know you need a different value, you should choose <b>optional</b> for your packages.
+ Unless you know you need a different value, you should choose **optional** for your packages.
"""
),
),
@@ -816,8 +817,8 @@ SOURCE_FIELDS = _fields(
**Example**:
```
Uploaders:
- John Doe &lt;john@doe.org&gt;,
- Lisbeth Worker &lt;lis@worker.org&gt;,
+ John Doe <john@doe.org>,
+ Lisbeth Worker <lis@worker.org>,
```
Formally uploaders are considered co-maintainers for the package with the party listed in the
@@ -947,7 +948,7 @@ SOURCE_FIELDS = _fields(
It was used to enabling Debian Maintainers to upload the package without requiring a Debian Developer
to sign the package. This mechanism has been replaced by a new authorization mechanism.
- Please see https://lists.debian.org/debian-devel-announce/2012/09/msg00008.html for details about the
+ Please see <https://lists.debian.org/debian-devel-announce/2012/09/msg00008.html> for details about the
replacement.
```
"""
@@ -973,7 +974,7 @@ SOURCE_FIELDS = _fields(
These build-dependencies must be satisfied when executing the **build-arch** and **binary-arch**
targets either directly or indirectly in addition to those listed in **Build-Depends**.
- Note that these dependencies are <em>not</em> available during **clean**.
+ Note that these dependencies are *not* available during **clean**.
"""
),
),
@@ -988,7 +989,7 @@ SOURCE_FIELDS = _fields(
These build-dependencies must be satisfied when executing the **build-indep** and **binary-indep**
targets either directly or indirectly in addition to those listed in **Build-Depends**.
- Note that these dependencies are <em>not</em> available during **clean**.
+ Note that these dependencies are *not* available during **clean**.
"""
),
),
@@ -1045,9 +1046,9 @@ SOURCE_FIELDS = _fields(
Please refer to the documentation of the **autodep8** package for which values you can put into
this field and what kind of testsuite the keywords will provide.
- Declaring this field in *debian/control* is only necessary when you want additional tests beyond
- those in *debian/tests/control* as **dpkg** automatically records the package provided ones from
- *debian/tests/control*.
+ Declaring this field in `debian/control` is only necessary when you want additional tests beyond
+ those in `debian/tests/control` as **dpkg** automatically records the package provided ones from
+ `debian/tests/control`.
"""
),
),
@@ -1101,7 +1102,7 @@ SOURCE_FIELDS = _fields(
performance cost. This field can be used to explicitly declare that the legacy behaviour is
unnecessary.
- **Example:**
+ **Example**:
```
Rules-Requires-Root: no
```
@@ -1180,7 +1181,7 @@ SOURCE_FIELDS = _fields(
Used for non-free packages to denote that they may be auto-build on the Debian build infrastructure
Note that adding this field **must** be combined with following the instructions at
- https://www.debian.org/doc/manuals/developers-reference/pkgs.html#non-free-buildd
+ <https://www.debian.org/doc/manuals/developers-reference/pkgs.html#non-free-buildd>
"""
),
),
@@ -1200,7 +1201,7 @@ SOURCE_FIELDS = _fields(
intended to provide a one-line summary of a package. The lines after the **Synopsis** is known
as the **Extended Description** and is intended as a longer summary of a package.
- **Example:**
+ **Example**:
```
Description: documentation generator for Python projects
Sphinx is a tool for producing documentation for Python projects, using
@@ -1225,7 +1226,7 @@ SOURCE_FIELDS = _fields(
part is inserted into a sentence like "The package provides {{Synopsis-goes-here}}". The
**Extended Description** is a standalone description that should describe what the package does and
how it relates to the rest of the system (in terms of, for example, which subsystem it is which part of).
- Please see https://www.debian.org/doc/debian-policy/ch-controlfields.html#description for more details
+ Please see <https://www.debian.org/doc/debian-policy/ch-controlfields.html#description> for more details
about the description field and suggestions for how to write it.
"""
),
@@ -1508,7 +1509,7 @@ BINARY_FIELDS = _fields(
Declare this package also provide one or more other packages. This means that this package can
substitute for the provided package in some relations.
- *Example*:
+ **Example**:
```
Package: foo
...
@@ -1521,7 +1522,7 @@ BINARY_FIELDS = _fields(
declare a version, then it *cannot* be used to satisfy a dependency with a version restriction.
Consider the following example:
- **Archive scenario*: (This is *not* a debian/control file, despite the resemblance)
+ **Archive scenario**: (This is *not* a `debian/control` file, despite the resemblance)
```
Package foo
Depends: bar (>= 1.0)
@@ -1653,7 +1654,7 @@ BINARY_FIELDS = _fields(
This field is primarily used in combination with build profiles inside the build dependency related fields
to reduce the number of build dependencies required during bootstrapping of a new architecture.
- **Example*:
+ **Example**:
```
Package: foo
...
@@ -1666,7 +1667,7 @@ BINARY_FIELDS = _fields(
Note that there is an official list of "common" build profiles with predefined purposes along with rules
for how and when the can be used. This list can be found at
- https://wiki.debian.org/BuildProfileSpec#Registered_profile_names.
+ <https://wiki.debian.org/BuildProfileSpec#Registered_profile_names>.
"""
),
),
@@ -1681,12 +1682,12 @@ BINARY_FIELDS = _fields(
"""\
Define the section for this package.
- Example:
+ **Example**:
```
Section: devel
```
- Please see https://packages.debian.org/unstable for more details about the sections.
+ Please see <https://packages.debian.org/unstable> for more details about the sections.
"""
),
),
@@ -1697,73 +1698,19 @@ BINARY_FIELDS = _fields(
warn_if_default=False,
missing_field_severity=DiagnosticSeverity.Error,
inherits_from_source=True,
- known_values=_allowed_values(
- Keyword(
- "required",
- hover_text=textwrap.dedent(
- """\
- The package is necessary for the proper functioning of the system (read: dpkg needs it).
-
- Applicable if dpkg *needs* this package to function and it is not a library.
-
- No two packages that both have a priority of *standard* or higher may conflict with
- each other.
- """
- ),
- ),
- Keyword(
- "important",
- hover_text=textwrap.dedent(
- """\
- The *important* packages are a bare minimum of commonly-expected and necessary tools.
-
- Applicable if 99% of all users in the distribution needs this package and it is not a library.
-
- No two packages that both have a priority of *standard* or higher may conflict with
- each other.
- """
- ),
- ),
- Keyword(
- "standard",
- hover_text=textwrap.dedent(
- """\
- These packages provide a reasonable small but not too limited character-mode system. This is
- what will be installed by default (by the debian-installer) if the user does not select anything
- else. This does not include many large applications.
-
- Applicable if your distribution installer will install this package by default on a new system
- and it is not a library.
-
- No two packages that both have a priority of *standard* or higher may conflict with
- each other.
- """
- ),
- ),
- Keyword(
- "optional",
- hover_text="This is the default priority and used by the majority of all packages"
- " in the Debian archive",
- ),
- Keyword(
- "extra",
- is_obsolete=True,
- replaced_by="optional",
- hover_text="Obsolete alias of `optional`.",
- ),
- ),
+ known_values=ALL_PRIORITIES,
hover_text=textwrap.dedent(
"""\
Define the priority this package.
The priority field describes how important the package is for the functionality of the system.
- Example:
+ **Example**:
```
Priority: optional
```
- Unless you know you need a different value, you should choose <b>optional</b> for your packages.
+ Unless you know you need a different value, you should choose **optional** for your packages.
"""
),
),
@@ -1965,7 +1912,7 @@ BINARY_FIELDS = _fields(
item can be architecture dependent. For architecture dependent menu item values, use a
custom substvar.
- See https://d-i.debian.org/doc/internals/apa.html for the full list of menu item ranges
+ See <https://d-i.debian.org/doc/internals/apa.html> for the full list of menu item ranges
and for how to request a number.
"""
),
@@ -2055,7 +2002,7 @@ BINARY_FIELDS = _fields(
intended to provide a one-line summary of the package. The lines after the **Synopsis** is known
as the **Extended Description** and is intended as a longer summary of the package.
- **Example:**
+ **Example**:
```
Description: documentation generator for Python projects
Sphinx is a tool for producing documentation for Python projects, using
@@ -2080,7 +2027,7 @@ BINARY_FIELDS = _fields(
part is inserted into a sentence like "The package provides {{Synopsis-goes-here}}". The
**Extended Description** is a standalone description that should describe what the package does and
how it relates to the rest of the system (in terms of, for example, which subsystem it is which part of).
- Please see https://www.debian.org/doc/debian-policy/ch-controlfields.html#description for more details
+ Please see <https://www.debian.org/doc/debian-policy/ch-controlfields.html#description> for more details
about the description field and suggestions for how to write it.
"""
),
@@ -2110,7 +2057,7 @@ BINARY_FIELDS = _fields(
XB-Cnf-Visible-Pkgname: python3
```
- Related bug: https://bugs.launchpad.net/ubuntu/+source/python-defaults/+bug/1867157
+ Related bug: <https://bugs.launchpad.net/ubuntu/+source/python-defaults/+bug/1867157>
"""
),
),
@@ -2124,7 +2071,7 @@ BINARY_FIELDS = _fields(
Please refer to the documentation of `dh_ruby` for more details.
- https://manpages.debian.org/dh_ruby
+ <https://manpages.debian.org/dh_ruby>
"""
),
),
@@ -2141,7 +2088,7 @@ _DEP5_HEADER_FIELDS = _fields(
FieldValueClass.FREE_TEXT_FIELD,
),
Deb822KnownField(
- "Upstream-Contract",
+ "Upstream-Contact",
FieldValueClass.FREE_TEXT_FIELD,
),
Deb822KnownField(
@@ -2257,7 +2204,7 @@ _DTESTSCTRL_FIELDS = _fields(
Declares that the specified packages must be installed for the test
to go ahead. This supports all features of dpkg dependencies, including
the architecture qualifiers (see
- https://www.debian.org/doc/debian-policy/ch-relationships.html),
+ <https://www.debian.org/doc/debian-policy/ch-relationships.html>),
plus the following extensions:
`@` stands for the package(s) generated by the source package
@@ -2342,7 +2289,7 @@ _DTESTSCTRL_FIELDS = _fields(
Please use this considerately, as for large builds it unnecessarily
builds the entire project when you only need a tiny subset (like the
- tests/ subdirectory). It is often possible to run `make -C tests`
+ `tests/` subdirectory). It is often possible to run `make -C tests`
instead, or copy the test code to `$AUTOPKGTEST_TMP` and build it
there with some custom commands. This cuts down the load on the
Continuous Integration servers and also makes tests more robust as
@@ -2549,7 +2496,7 @@ _DTESTSCTRL_FIELDS = _fields(
The test(s) needs write access to the built source tree (so it may
need to be copied first). Even with this restriction, the test is
not allowed to make any change to the built source tree which (i)
- isn't cleaned up by debian/rules clean, (ii) affects the future
+ isn't cleaned up by `debian/rules clean`, (ii) affects the future
results of any test, or (iii) affects binary packages produced by
the build tree in the future.
"""
@@ -2667,7 +2614,7 @@ _DTESTSCTRL_FIELDS = _fields(
path and is interpreted starting from the root of the built source
tree.
- This allows tests to live outside the debian/ metadata area, so that
+ This allows tests to live outside the `debian/` metadata area, so that
they can more palatably be shared with non-Debian distributions.
"""
),
diff --git a/src/debputy/plugin/debputy/private_api.py b/src/debputy/plugin/debputy/private_api.py
index 6d60333..8428a5f 100644
--- a/src/debputy/plugin/debputy/private_api.py
+++ b/src/debputy/plugin/debputy/private_api.py
@@ -682,7 +682,7 @@ def register_variables_via_private_api(api: DebputyPluginInitializerProvider) ->
"SOURCE_DATE_EPOCH": textwrap.dedent(
"""\
Timestamp from the top most changelog entry (`dpkg-parsechangelog -STimestamp`)
- Please see https://reproducible-builds.org/docs/source-date-epoch/ for the full definition of
+ Please see <https://reproducible-builds.org/docs/source-date-epoch/> for the full definition of
this variable.
"""
),