Continuous Integration for EmacsLisp without pain!
The goal of Cask Package Toolset is to promote the use of integration and tests to have even better emacs library, where it’s more easy to contribute and build new features! :) All that without fearing regressions, and unwanted breaking changes.
It does that by helping you to start or tool up your emacs package project with best continuous integration practices and emacs tools. Among which travis, evm, ert-runner, ecukes, Cask, undercover, coveralls.
This is inspired from the following blog post of @Rejeep who had brought to us Cask, Ert-runner and Emacs Version Management (and many more :)).
Just add this has dependency to your Cask
file
(depends-on "cask-package-toolset")
- View usage information:
$ cask exec package-toolset help
- View package status:
$ cask exec package-toolset status
- Install all the tools
$ cask exec package-toolset install
- Print the melpa recipe for your repository
$ cask exec package-toolset melpa-recipe
- Print the badges for the
README
$ cask exec package-toolset badge
- Setup unit test with ert and ert-runner:
$ cask exec package-toolset setup-ert
- Get the code to setup coverage with undercover
$ cask exec package-toolset setup-undercover
- Update travis config if needed with update-travis
$ cask exec package-toolset update-travis
- In case your
origin
remote is not targeting your github repository, you can specify it with the-r <remote>
or--remote <remote>
option - You could otherwise directly specify your repositoryname with the
-g
or--github-repo
option. (don’t forget your yoursername or put a stub one ;)-g toto/secret.el
) - For the badges creation, you can specify the syntax you want with
-s <syntax>
or--syntax <syntax>
. Legit values areorgmode
,markdown
,rst
andhtml
,markown
being the default
Here is the list of the scaffold file to set up continuous integration for your emacs package.
- The
setup
,install
command is to be run first, and will setup the following files- Makefile : The
Makefile
, and it’stest
targets - .gitgnore : A classic
gitignore
designed for a casked emacs package - .travis.yml : The build configuration file for Travis.
- Makefile : The
- The
setup-ert
will setup unit test structure:- test-helper : Require testing libraries such as
ert
,el-mock
, helper libraries (dash
s
) and setup useful variables to different path of the project. It also set up a convenience macrowith-sandbox
to perform operation in a test directory. - package-test : the file in which the test will have to be written :) (cpt can’t do that for you ;))
- .ert-runner : configuration of the ert runner. (adding files to the loadpath)
- test-helper : Require testing libraries such as
- The
setup-undercover
will help you set up coverage.It will output the code that need to be added to
test/test-helper.el
andfeatures/support/env.el
so that coverage metrics are computed while testing.
Cask Package Toolset will help you build badges to add to your README, so you can have an idea about
the current state of the package in just a glance.
Calling the badge
command will output you a list of badges link you can then copy paste to your README.
So far support information such as build status, coverage, melpa status, licence, and also gitter.
Cask Package Toolset supports three different syntaxes: orgmode, markdown and html.
By default you’ll get markdown, but you can explicitely specify one of the syntax with the -s/--syntax
option.
If you have not yet published your package to melpa, Cask Package Toolset can easily build up the basic recipe for you’ll just have to add to the melpa repository. Note that you might need to add something more than the name and repo (such as extra files to be included)
This is no more a prototype, but some features are still added, driven by examples by the toolsettization of my own packages.
I will see with the Cask
team to incorporate it so that that it can be accessed without adding it has Cask dependancy.
If you have any remark, refactor suggestion or else, just pose an issue ;)