A linter is an analysis tool that checks for common errors or compatibility issues, usually automatically, or as part of some other process.
Snapcraft (from version 7.2 onwards) includes its own linter functionality when working with snaps using the
Snapcraft linters run automatically when a snap is packed unless otherwise disabled.
Snapcraft currently offers the following linters:
classic: verifies binary file parameters for snaps using classic confinement
library: verifies that no ELF file dependencies, such as libraries, are missing
Snapcraft linters run automatically when a snap is packed but specific linters can be disabled by specifying a
ignore entry in the
lint section of
lint: ignore: - classic - library
ignore entry must include one or more linter names for those linters to be disabled.
Ignore specific files
To omit specific files from a linter, add their snap location under the linter name:
lint: ignore: - classic - library: - usr/lib/**/libfoo.so*
In the above example, the
classic linter will be disabled entirely, and the
library linter will not run for the files matching the specified file pattern.