Skip to content

Commit

Permalink
Add and setup linting in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
volrath committed Dec 29, 2017
1 parent cdbbcee commit 6ff3553
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Expand Up @@ -16,12 +16,14 @@ before_install:
install:
- cask install
script:
- export ECUKES_EMACS=${EMACS:-$(which emacs)}
- $ECUKES_EMACS --version
# Lint
- cask emacs -batch -L . -l tests/lint.el
# Test
- echo "*** Starting Socket REPL on 5555 ***"
- clojure -e "(do (require 'clojure.core.server) (clojure.core.server/start-server {:name :repl :port 5555 :accept 'clojure.core.server/repl :server-daemon false}))" &
- until sudo fuser 5555/tcp; do sleep 0.1; done;
- echo "*** Socket REPL Started ***"
- echo "*** Emacs Version ***"
- export ECUKES_EMACS=${EMACS:-$(which emacs)}
- $ECUKES_EMACS --version
- cask exec buttercup -L . tests
- kill $!
50 changes: 50 additions & 0 deletions tests/lint.el
@@ -0,0 +1,50 @@
;;; lint.el --- Make sure everything is tidy -*- lexical-binding: t; -*-
;;
;; Filename: test-repl.el
;; Author: Daniel Barreto
;; Copyright (C) 2017 Daniel Barreto
;; Created: Sun Dec 17 23:42:58 2017 (+0100)
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; Lint Emacs Lisp files.
;; Borrowed from Nicolas Petton's `indium'.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:

(require 'checkdoc)
(require 'seq)

(let ((checkdoc-arguments-in-order-flag nil)
(checkdoc-symbol-words '("UNREPL" "unrepl" "stdout" "print-level" "print-length"))
(files (seq-filter (lambda (file)
(and (string= (file-name-extension file) "el")
(string-prefix-p "spiral" file)))
(directory-files "."))))
(seq-doseq (file files)
(with-current-buffer (find-file file)
(message "Linting %s..." file)
(checkdoc-current-buffer))))

(provide 'lint)

;;; lint.el ends here

0 comments on commit 6ff3553

Please sign in to comment.