Skip to content

AdrieanKhisbe/cask-package-toolset.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cask Package Toolset

https://travis-ci.org/AdrieanKhisbe/cask-package-toolset.el.svg?branch=master https://coveralls.io/repos/AdrieanKhisbe/cask-package-toolset.el/badge.svg http://melpa.org/packages/cask-package-toolset-badge.svg http://stable.melpa.org/packages/cask-package-toolset-badge.svg https://img.shields.io/github/tag/AdrieanKhisbe/cask-package-toolset.el.svg http://img.shields.io/:license-gpl3-blue.svg https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg

Continuous Integration for EmacsLisp without pain!

About

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 :)).

Installation

Just add this has dependency to your Cask file

(depends-on "cask-package-toolset")

Usage

  • 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
        

Options

  • 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 are orgmode, markdown, rst and html, markown being the default

Features

Skeleton File List

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’s test targets
    • .gitgnore : A classic gitignore designed for a casked emacs package
    • .travis.yml : The build configuration file for Travis.
  • 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 macro with-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)
  • The setup-undercover will help you set up coverage.

    It will output the code that need to be added to test/test-helper.el and features/support/env.el so that coverage metrics are computed while testing.

Badges

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.

Melpa Recipe

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)

Notes

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 ;)