Skip to content

Commit

Permalink
project management: Cask, tests and CI
Browse files Browse the repository at this point in the history
Use the ``cask`` library for project management.  Use ``ert`` for tests.
Adds an exemplary test for the PEP8Bear.  CI is also part of project
management.

Closes coala#11
  • Loading branch information
fleimgruber committed May 14, 2017
1 parent b94c111 commit 0c3fe13
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .coafile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Default]
enabled = True

[commit]
bears = GitCommitBear

[python]
bears = PEP8Bear
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
language: python
sudo: no
python:
- 3.4
- 3.5
env:
# - EVM_EMACS=emacs-24.1-travis
# - EVM_EMACS=emacs-24.2-travis
- EVM_EMACS=emacs-24.3-travis
- EVM_EMACS=emacs-24.4-travis
- EVM_EMACS=emacs-24.5-travis
- EVM_EMACS=emacs-25.1-travis
- EVM_EMACS=emacs-25.2-travis
# - EVM_EMACS=emacs-git-snapshot
before_install:
- curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > travis.sh && source ./travis.sh
- evm install $EVM_EMACS --use --skip
- cask
install:
- pip install coala
- pip install flake8
- pip install coveralls
script:
- PYTHONPATH="`pwd`" cask exec ert-runner
after_success:
- coveralls
10 changes: 10 additions & 0 deletions Cask
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(source gnu)
(source melpa)

(package "flycheck-coala" "0.1" "Flycheck plugin for coala.io code analyzer")

(development
(depends-on "dash")
(depends-on "flycheck")
(depends-on "f")
(depends-on "ert-runner"))
23 changes: 23 additions & 0 deletions test/coala-test.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
;;; coala-emacs --- tests
;;; Commentary:
(require 'flycheck)
(require 'flycheck-ert)

;;; Code:

;;; Directories

(flycheck-ert-def-checker-test coala python coala-python
(let ((setup-geiser
(lambda ()
(setq-local geiser-scheme-implementation 'chicken)
(geiser-mode))))
(add-hook 'scheme-mode-hook setup-geiser)
(unwind-protect
(flycheck-ert-should-syntax-check
"test/resources/language/pep8.py" 'python-mode
'(1 nil info "The code does not comply to PEP8."
:checker coala)))))

(provide 'coala-test)
;;; coala-test.el ends here
1 change: 1 addition & 0 deletions test/resources/language/pep8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a = 1 + 1 # <- not PEP8 compliant
8 changes: 8 additions & 0 deletions test/test-helper.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
;; -*- lexical-binding: t -*-

(require 'f)
(let ((coala-emacs-dir (f-parent (f-dirname (f-this-file)))))
(add-to-list 'load-path coala-emacs-dir)
(add-to-list 'process-environment (format "PYTHONPATH=%s" coala-emacs-dir))
(add-to-list 'process-environment "ELPY_TEST=1"))
(require 'flycheck-coala)

0 comments on commit 0c3fe13

Please sign in to comment.