/IDEA-debpkg

Support for common Debian packaging files in IntelliJ/PyCharm (e.g. debian/control and debian/changelog).

Primary LanguageJavaApache License 2.0Apache-2.0

debpkg - Debian Packaging Support

Build Version Downloads

Debian Packaging Support

Support for common Debian packaging files (e.g. debian/control and debian/changelog).

This is an IDEA plugin (e.g. IntelliJ or PyCharm) that enables support for some commonly used formats in Debian packaging.

Features

debian/changelog or (*.dch)

  • Basic syntax highlighting with syntactical validation.
  • Spellchecking of changelog content (but not bits you cannot control).
  • Bundled spelling dictionary with common Debian package related terms and jargon to avoid some false-positive spelling mistakes.
  • Debian and Ubuntu bug numbers in Closes and http/https addresses are linkified.
  • A structure view providing a quick navigation overview for individual versions. (View > Tool Windows > Structure)

debian/control

  • Basic syntax highlighting with syntactical validation plus highlight of known field values.
  • Basic (incomplete) validation of field values.
  • Completion of field names, known values for fields and known substitution variables.
  • Documentation for fields, known values in fields and known substitution variables ("mouse-over")
  • Spellchecking of relevant fields (e.g. Description).
  • Check fields are placed in a paragraph where it makes sense.
  • Folding of long field values with Description folded by default (also includes comments).
  • Validate dependency fields for use of unsupported version operators (e.g. in Provides) or build profile restrictions (in any binary package relation field).
  • Warn if a field just duplicates the field of the source paragraph.
  • Refactor support when renaming binary packages (includes renaming files in debian/* but not content inside debian/rules).
  • Detection of some possible mistakes (package name does not match section/architecture, missing substvars)
  • Detect misspellings of known fields such as Depend being a typo of Depends.
  • Detect non-canonical variants of fields (depends -> Depends or XC-Package-Type -> Package-Type).

Plus the features listed for Generic deb822 files.

debian/tests/control

  • Basic syntax highlighting with syntactical validation plus highlight of known field values.
  • Basic (incomplete) validation of field values.
  • Completion of field names and known values for fields.
  • Documentation for fields, known values in fields ("mouse-over")
  • Folding of long field values (also includes comments).
  • Detect misspellings of known fields such as Depend being a typo of Depends.
  • Detect non-canonical variants of fields (depends -> Depends or XC-Package-Type -> Package-Type).

Plus the features listed for Generic deb822 files.

debian/copyright

  • Conditional detection as a Deb822 file based on the presence of the Format: field. The matching is conditional as debian/copyright to avoid false-positives for projects that do not use the machine-readable Debian copyright format (also known as DEP-5).
  • Completion of field names of common known fields plus file names in the Files: field.
  • Documentation for some known fields ("mouse-over")
  • Folding of long field values with License and Copyright folded by default (also includes comments).
  • Check fields are placed in a paragraph where it makes sense.
  • Basic verification of patterns in the Files field. The plugin only partly supports wildcards and will err on the side of assuming a wildcard matches when in doubt.
  • Spellchecking of relevant fields (e.g. Comment, Disclaimer and Source).
  • Valid paths without wildcards in the Files fields are turned into references, which in turn enables other features such as "jump to" and Refactor support.
  • Detect misspellings of known fields such as Licenses being a typo of License.
  • Detect non-canonical variants of fields (files -> Files).

Plus the features listed for Generic deb822 files.

Notably missing features for debian/copyright. The License fields are not validated.

Apt sources (deb822-based) files

  • Basic syntax highlighting with syntactical validation plus highlight of known field values.
  • Basic (incomplete) validation of field values.
  • Completion of field names and known values for fields.
  • Documentation for fields, known values in fields ("mouse-over")
  • Folding of long field values (also includes comments).
  • Detect misspellings of known fields such as Type being a typo of Types.
  • Detect non-canonical variants of fields (types -> Types).

Plus the features listed for Generic deb822 files.

Generic deb822 files (*.deb822, *.dsc, *_*_*.buildinfo, *_*_*.changes)

  • Basic syntax highlighting.
  • Basic semantic validation (i.e. no duplicate fields)
  • Support for adding / removing comments via the Code > Comment with Line Comment feature.
  • Folding of long field values.
  • Bundled spelling dictionary with common Debian package related terms and jargon to avoid some false-positive spelling mistakes.
  • Folding support to hide GPG signatures. There is no logic to determine whether the given file permits the GPG signature.
  • Spellchecking in selected fields guessed from their names, where the specific subformat does not provide a more reliable selection.
  • Quick fix for some syntactical issues with continuation lines.
  • URLs in field values are linkified.

Apt Sources .list file

  • Auto-detection of the file (any .list except index.list, which is a common name for JAR index files.)
  • Basic syntax highlighting of context. No semantic validation though.

Getting started

After installing the plugin, it automatically detects relevant files supported and start applying highlights and relevant validation rules based on common patterns such as debian/control or *.deb822.

Note that most of the auto-detection rules relies on the files being placed in the debian directory (such as debian/control and debian/changelog). A few formats that are usually generated (and not hand edited) will only be auto-detected if the file uses the common pattern for that file type (e.g. NAME_VERSION_ARCH.changes). This is deliberate to reduce false positives in case other plugins react to similar extensions.

Alternatively, you can set the file type manually by using IDEA's Associate with File Type... feature.

Once associated, the supported feature set automatically activates on the relevant editor actions.

Installation

  • Using IDE built-in plugin system:

    Preferences > Plugins > Marketplace > Search for "Debian Packaging Support" > Install Plugin

  • Manually:

    Download the latest release and install it manually using Preferences > Plugins > ⚙️ > Install plugin from disk...


Plugin based on the IntelliJ Platform Plugin Template.