Commit 42380909 authored by Mario Rodas's avatar Mario Rodas

Add protobuf checker

parent e86fa19a
31-cvs (in development)
=======================
- New syntax checkers:
- Protobuf with ``protoc`` [GH-1125]
30 (Oct 12, 2016)
=================
......
......@@ -32,6 +32,7 @@
(depends-on "mmm-mode")
(depends-on "php-mode")
(depends-on "processing-mode")
(depends-on "protobuf-mode")
(depends-on "pug-mode")
(depends-on "puppet-mode")
(depends-on "racket-mode")
......
......@@ -706,6 +706,14 @@ to view the docstring of the syntax checker. Likewise, you may use
Check syntax using the `Processing <https://processing.org/>`_ compiler.
.. supported-language:: Protobuf
.. syntax-checker:: protobuf-protoc
Check syntax using the protoc_ compiler.
.. _protoc: https://developers.google.com/protocol-buffers/
.. supported-language:: Pug
.. syntax-checker:: pug
......
......@@ -213,6 +213,7 @@ attention to case differences."
php-phpmd
php-phpcs
processing
protobuf-protoc
pug
puppet-parser
puppet-lint
......@@ -7974,6 +7975,26 @@ See https://github.com/processing/processing/wiki/Command-Line"
;; This syntax checker needs a file name
:predicate (lambda () (buffer-file-name)))
(flycheck-define-checker protobuf-protoc
"A protobuf syntax checker using the protoc compiler.
See URL `https://developers.google.com/protocol-buffers/'."
:command ("protoc" "--error_format" "gcc"
(eval (concat "--java_out=" (flycheck-temp-dir-system)))
;; Add the file directory of protobuf path to resolve import directives
(eval (concat "--proto_path=" (file-name-directory (buffer-file-name))))
source-inplace)
:error-patterns
((info line-start (file-name) ":" line ":" column
": note: " (message) line-end)
(error line-start (file-name) ":" line ":" column
": " (message) line-end)
(error line-start
(message "In file included from") " " (file-name) ":" line ":"
column ":" line-end))
:modes protobuf-mode
:predicate (lambda () (buffer-file-name)))
(flycheck-define-checker pug
"A Pug syntax checker using the pug compiler.
......
......@@ -3545,6 +3545,12 @@ Why not:
'(4 2 error "Syntax error, maybe a missing semicolon?"
:checker processing)))
(flycheck-ert-def-checker-test protobuf-protoc protobuf syntax-error
(flycheck-ert-should-syntax-check
"language/protobuf.proto" 'protobuf-mode
'(2 23 error "Missing field number."
:checker protobuf-protoc)))
(flycheck-ert-def-checker-test pug pug syntax-error
(flycheck-ert-should-syntax-check
"language/pug/pug.pug" 'pug-mode
......
message Person {
required string name;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment