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 opam checker #1532

Merged
merged 1 commit into from Jan 8, 2019
Merged

Conversation

marsam
Copy link
Contributor

@marsam marsam commented Dec 28, 2018

I've added checker for opam files with https://opam.ocaml.org/doc/man/opam-lint.html

tests

make SELECTOR='(tag checker-opam)' integ
cask exec emacs -Q --batch -L .  -l maint/flycheck-compile.el -f flycheck/batch-byte-compile flycheck.el
cask exec emacs -Q --batch -L .  -l maint/flycheck-compile.el -f flycheck/batch-byte-compile flycheck-ert.el
cask exec emacs -Q --batch -L .  --load test/flycheck-test --load test/run.el -f flycheck-run-tests-main '(and (tag external-tool) (tag checker-opam))'
Running tests on Emacs 26.1, built at 2018-12-19
Running 1 tests (2018-12-28 14:34:23-0500)
   passed  1/1  flycheck-define-checker/opam/default

Ran 1 tests, 1 results as expected (2018-12-28 14:34:25-0500)

@marsam marsam force-pushed the feature/add-opam-lint-checker branch 2 times, most recently from 6bfcf35 to 2d07ec2 Compare Dec 30, 2018
Copy link
Member

@cpitclaudel cpitclaudel left a comment

Thanks! LGTM. Just two small comments.


.. syntax-checker:: opam

Check Nix with `opam lint`_.
Copy link
Member

@cpitclaudel cpitclaudel Jan 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this say check opam rather than Check Nix?
It would help to also detail what Opam is (Opam configuration files?)

Copy link
Contributor Author

@marsam marsam Jan 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that 😅 , replaced with "Check Opam configuration files"

See URL `https://opam.ocaml.org/doc/man/opam-lint.html'."
:command ("opam" "lint" "-")
:standard-input t
:error-patterns
Copy link
Member

@cpitclaudel cpitclaudel Jan 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a --json option to opam-lint that produces json output, but it can only write to a file, apparently (and it doesn't seem to write all errors). It might be worth asking the OPAM devs to add a new flag to get json output for all errors.

Copy link
Contributor Author

@marsam marsam Jan 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that --json flag just write a log to a file; the closest issue I could find ocaml/opam#3046

@marsam marsam force-pushed the feature/add-opam-lint-checker branch from 2d07ec2 to aaab5ce Compare Jan 8, 2019
@cpitclaudel cpitclaudel merged commit 6f14c51 into flycheck:master Jan 8, 2019
2 checks passed
@cpitclaudel
Copy link
Member

@cpitclaudel cpitclaudel commented Jan 8, 2019

Great job, thanks a lot!

@marsam marsam deleted the feature/add-opam-lint-checker branch Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants