Update library headers homepage
[arduino-mode.git] / flycheck-arduino.el
blob1fe0bd6eb977696af4af94a113cc308163f7807e
1 ;;; flycheck-arduino.el --- Arduino support for flycheck. -*- lexical-binding: t; -*-
3 ;; Authors: stardiviner <numbchild@gmail.com>
4 ;; Version: 0.1
5 ;; Keywords: arduino flycheck
7 ;; flycheck-arduino is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 3, or (at your option)
10 ;; any later version.
12 ;; flycheck-arduino is distributed in the hope that it will be useful, but WITHOUT
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 ;; License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
21 ;;; Commentary:
25 ;;; Code:
27 (require 'flycheck)
29 (defvar flycheck-arduino-board nil
30 "The Arduino board to be used for debugging Sketch.")
32 (flycheck-define-checker arduino
33 "Arduino checker using Arduino IDE. (This requires higher than version 1.5+).
34 See `https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc'."
35 ;; source, source-inplace, source-original
36 :command ("arduino" "--verify" source)
37 ;; :command `("arduino-cli" "debug" "-b" ,flycheck-arduino-board ,(projectile-project-root))
38 :error-patterns
39 (;; I don't make sure about this warning... How to emit a warning?
40 (warning line-start (file-name) ":" line ":" column ": warning: " (message) line-end)
41 (error line-start (file-name) ":" line ":" column ": " (0+ "fatal ") "error: " (message) line-end))
42 :modes (arduino-mode))
44 ;;;###autoload
45 (defun flycheck-arduino-setup ()
46 "Setup Flycheck Arduino.
47 Add `arduino' to `flycheck-checkers'."
48 (interactive)
49 (add-to-list 'flycheck-checkers 'arduino))
52 ;; Can't be compiled when `flycheck' is not available.
53 ;; Local Variables:
54 ;; no-byte-compile: t
55 ;; End:
57 (provide 'flycheck-arduino)
58 ;;; flycheck-arduino.el ends here