diff --git a/.coafile b/.coafile new file mode 100644 index 0000000..7c19542 --- /dev/null +++ b/.coafile @@ -0,0 +1,8 @@ +[Default] +enabled = True + +[commit] +bears = GitCommitBear + +[python] +bears = PEP8Bear \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b737b34 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +language: python +sudo: no +python: + - 3.4 + - 3.5 + - 3.6 +env: + - EVM_EMACS=emacs-24.4-travis + - EVM_EMACS=emacs-24.5-travis + - EVM_EMACS=emacs-25.1-travis + - EVM_EMACS=emacs-25.2-travis +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 -r requirements.txt +script: + - PYTHONPATH="`pwd`" cask exec ert-runner diff --git a/Cask b/Cask new file mode 100644 index 0000000..184bc18 --- /dev/null +++ b/Cask @@ -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")) \ No newline at end of file diff --git a/README.md b/README.md index bcb414e..dedf9c2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ Flycheck coala Checker ====================== +[![Build Status](https://travis-ci.org/fleimgruber/coala-emacs.svg?branch=master)](https://travis-ci.org/fleimgruber/coala-emacs) Integrate [coala](https://coala.io) with [flycheck](http://www.flycheck.org). diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e20a020 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +coala +coala-bears +pyflakes~=1.4.0 diff --git a/test/coala-test.el b/test/coala-test.el new file mode 100644 index 0000000..fcb5b58 --- /dev/null +++ b/test/coala-test.el @@ -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 diff --git a/test/resources/language/pep8.py b/test/resources/language/pep8.py new file mode 100644 index 0000000..a0dd957 --- /dev/null +++ b/test/resources/language/pep8.py @@ -0,0 +1 @@ +a = 1 + 1 # <- not PEP8 compliant diff --git a/test/test-helper.el b/test/test-helper.el new file mode 100644 index 0000000..8b3b1c8 --- /dev/null +++ b/test/test-helper.el @@ -0,0 +1,7 @@ +;; -*- 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))) +(require 'flycheck-coala)