Snaplint

dryer lint

My team at work has been focused on snaps this year and one thing we’ve tried to do internally is establish a set of best practices for snap packaging software. Toward that end I’ve been working on a little tool I’m calling snaplint to encode those practices and verify that we’re following them.

Right now you can run snaplint against your snapcraft project directory
and it will scan the prime subdirectory for the following things:

  • copyright (basically that you included usr/share/doc/*copyright*) for
    any stage-packages
  • developer cruft (things like header and object files or static libs
    that might have made their way into your snap)
  • libraries (examine the ELF files in your snap and look for libraries
    which aren’t used)

The next things I’m planning on adding are:

  • checking for copyright info from apps/parts themselves.
  • checking for mixing of incompatible licenses

I would love to hear suggestions on further improvements.

You can find the source at https://github.com/ssweeny/snaplint

And, of course if you’re running Ubuntu 16.04 or later you can try it on your own machine with:
$ snap install snaplint
$ snaplint path/to/your/project

CC BY 4.0 Snaplint by ssweeny.net is licensed under a Creative Commons Attribution 4.0 International License.

Author: ssweeny

I’m a software engineer based out of Pittsburgh, PA, USA. My opinions are my own, and do not reflect those of my wife, my employer, my child, or my cats. In fact there are very few areas in which we agree.