Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add protobuf checker #1125

Merged
merged 1 commit into from Oct 17, 2016
Merged

Add protobuf checker #1125

merged 1 commit into from Oct 17, 2016

Conversation

@marsam
Copy link
Contributor

@marsam marsam commented Sep 29, 2016

Add protobuf checker. It's basically same as flycheck-protobuf.el with minor changes

Related: #790

@lunaryorn
Copy link
Contributor

@lunaryorn lunaryorn commented Sep 30, 2016

@marsam Thanks. Will take a look soon :)

Copy link
Contributor

@lunaryorn lunaryorn left a comment

Please add a note for the new syntax checker to CHANGES.rst.

(message "In file included from") " " (file-name) ":" line ":"
column ":" line-end))
:modes protobuf-mode
:predicate (lambda () (buffer-file-name)))

This comment has been minimized.

@lunaryorn

lunaryorn Oct 4, 2016
Contributor

Why is a buffer-file-name required for this syntax checker?

This comment has been minimized.

@marsam

marsam Oct 8, 2016
Author Contributor

Given that the --proto_path= option adds the path of the file, and (buffer-file-name) can be nil I think is better have this predicate.

This comment has been minimized.

@lunaryorn

lunaryorn Oct 8, 2016
Contributor

Yup, I see.

This comment has been minimized.

@cpitclaudel

cpitclaudel Oct 17, 2016
Member

Small thing: wouldn't #'buffer-file-name work just as well as (lambda () (buffer-file-name))?

This comment has been minimized.

@lunaryorn

lunaryorn Oct 17, 2016
Contributor

I think so, but I like the explicit lambda for the sake of syntactic consistency.


See URL `https://developers.google.com/protocol-buffers/'."
:command ("protoc" "--error_format" "gcc"
(eval (concat "--java_out=" (flycheck-temp-dir-system)))

This comment has been minimized.

@lunaryorn

lunaryorn Oct 4, 2016
Contributor

I presume there is no option to entirely suppress the output?

This comment has been minimized.

@marsam

marsam Oct 8, 2016
Author Contributor

there is no option to supress the compiled output

This comment has been minimized.

@lunaryorn

lunaryorn Oct 8, 2016
Contributor

ok

See URL `https://developers.google.com/protocol-buffers/'."
:command ("protoc" "--error_format" "gcc"
(eval (concat "--java_out=" (flycheck-temp-dir-system)))
(eval (concat "--proto_path=" (file-name-directory (buffer-file-name))))

This comment has been minimized.

@lunaryorn

lunaryorn Oct 4, 2016
Contributor

What does this option do?

This comment has been minimized.

@marsam

marsam Oct 8, 2016
Author Contributor

It adds a directory to paths in which protobuf files will be searched to import. Is necessary, doesn't work otherwise.

This comment has been minimized.

@lunaryorn

lunaryorn Oct 8, 2016
Contributor

Ok, can you add a comment to explain that? Just so that we don't forget?

@marsam
Copy link
Contributor Author

@marsam marsam commented Oct 8, 2016

Hi, sorry for the delay. I've added the note to CHANGES.rst

The test pass in my machine:

make LANGUAGE=protobuf integ
cask exec emacs -Q --batch -L .  -l maint/flycheck-compile.el -f flycheck/batch-byte-compile flycheck-buttercup.el
cask exec emacs -Q --batch -L .  --load test/flycheck-test --load test/run.el -f flycheck-run-tests-main '(and (tag external-tool) (language protobuf))'
Running tests on Emacs 26.0.50.2, built at 2016-10-07
Running 1 tests (2016-10-07 20:51:39-0500)
   passed  1/1  flycheck-define-checker/protobuf-protoc/syntax-error

Ran 1 tests, 1 results as expected (2016-10-07 20:51:40-0500)

.. syntax-checker:: protobuf-protoc

Check syntax using the `protoc <https://developers.google.com/protocol-buffers/>`_ compiler.

This comment has been minimized.

@lunaryorn

lunaryorn Oct 8, 2016
Contributor

This line looks rather long. Can you wrap it to 80 characters?

See URL `https://developers.google.com/protocol-buffers/'."
:command ("protoc" "--error_format" "gcc"
(eval (concat "--java_out=" (flycheck-temp-dir-system)))
(eval (concat "--proto_path=" (file-name-directory (buffer-file-name))))

This comment has been minimized.

@lunaryorn

lunaryorn Oct 8, 2016
Contributor

Ok, can you add a comment to explain that? Just so that we don't forget?

@lunaryorn
Copy link
Contributor

@lunaryorn lunaryorn commented Oct 8, 2016

LGTM, but some minor style issues left.

@marsam
Copy link
Contributor Author

@marsam marsam commented Oct 14, 2016

Sorry for the delay, I've updated the pull request

@lunaryorn
Copy link
Contributor

@lunaryorn lunaryorn commented Oct 14, 2016

@marsam Thanks.

I'm sorry, but we had a release in between, so I need to ask you to rebase onto master and move the changelog entry.

@marsam
Copy link
Contributor Author

@marsam marsam commented Oct 14, 2016

Updated :)

@cpitclaudel
Copy link
Member

@cpitclaudel cpitclaudel commented Oct 17, 2016

LGTM; thanks @marsam! I added a small comment regarding buffer-file-name.

@lunaryorn lunaryorn merged commit 047d100 into flycheck:master Oct 17, 2016
3 checks passed
3 checks passed
approvals/lgtm this commit looks good
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants