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 syntax errors to chicken checker #1123

Merged
merged 1 commit into from Oct 4, 2016

Conversation

Projects
None yet
4 participants
@marsam
Contributor

marsam commented Sep 29, 2016

Hi:
I've added patterns for syntax errors to Chicken scheme checker.

@CLAassistant

This comment has been minimized.

CLAassistant commented Sep 29, 2016

CLA assistant check
All committers have signed the CLA.

@lunaryorn

Please refactor the test cases; and would you mind to take a look at the Travis CI error?

(flycheck-ert-should-syntax-check
"language/chicken/syntax-error-2.scm" 'geiser-mode
'(1 nil warning "not enough arguments\n\n (define)\n\n Expansion history:\n\n <syntax> (##core#begin (define))\n <syntax> (define) <--"
:checker scheme-chicken))))

This comment has been minimized.

@lunaryorn

lunaryorn Sep 29, 2016

Contributor

Please do not use more than one of these assertions per test, so please split this test case into multiple test cases

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Sep 29, 2016

Thanks for this change. @manuel-uberti Would you take a look?

@marsam

This comment has been minimized.

Contributor

marsam commented Sep 29, 2016

I've separated the test cases as your suggestion.

The failed build on travis-ci seems to be an error in flake8 and pydocstyle: https://travis-ci.org/flycheck/flycheck/jobs/163838822#L235. I think is unrelated to this change.

@lunaryorn

Please reduce the duplication for the Geiser mode setup, and rebase onto master which should get Travis CI green again.

Please also run the tests locally with make LANGUAGE=scheme integ to make sure that they pass—I don't have a scheme setup here.

(let ((setup-geiser
(lambda ()
(setq-local geiser-scheme-implementation 'chicken)
(geiser-mode))))

This comment has been minimized.

@lunaryorn

lunaryorn Sep 30, 2016

Contributor

I think we should reduce this duplication. Please define:

(defun flycheck/chicken-mode ()
  "Enable Scheme and Geiser mode for Chicken scheme."
  (scheme-mode)
  (setq-local geiser-scheme-implementation 'chicken)
  (geiser-mode))

and use 'flycheck/chicken-mode instead of 'geiser-mode in all flycheck-ert-should-syntax-check invocations instead.

This comment has been minimized.

@marsam

marsam Sep 30, 2016

Contributor

I tried to add (setq-local geiser-scheme-implementation 'chicken) (before and after calling geiser-mode) but didn't work, so I used (setq-local geiser-impl--implementation 'chicken) instead

@marsam

This comment has been minimized.

Contributor

marsam commented Sep 30, 2016

I've updated the pull request with your suggestions, and fixed the tests cases.

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Oct 1, 2016

@marsam Did you run the tests? Do they pass on your machine?

And could you just add a note to CHANGES.rst about this change? It's probably a bug fix isn't it?

@marsam

This comment has been minimized.

Contributor

marsam commented Oct 4, 2016

Sorry for the delay. Yeah, I ran the tests in my machine:

make LANGUAGE=scheme 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-buttercup.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) (language scheme))'
Running tests on Emacs 26.0.50.1, built at 2016-10-01
Running 3 tests (2016-10-03 20:34:08-0500)
   passed  1/3  flycheck-define-checker/scheme-chicken/default
   passed  2/3  flycheck-define-checker/scheme-chicken/syntax-error
   passed  3/3  flycheck-define-checker/scheme-chicken/syntax-read-error

Ran 3 tests, 3 results as expected (2016-10-03 20:34:12-0500)

also, I've added a note in CHANGES.rst

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Oct 4, 2016

@marsam Thanks, LGTM. @cpitclaudel Mind to take a look?

@cpitclaudel

This comment has been minimized.

Member

cpitclaudel commented Oct 4, 2016

LGTM; thanks @marsam!

@cpitclaudel cpitclaudel merged commit 6deaaeb into flycheck:master Oct 4, 2016

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

@marsam marsam deleted the marsam:feature/chicken-syntax-errors branch Oct 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment