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

Merged
merged 1 commit into from
Oct 4, 2016
Merged

Add syntax errors to chicken checker #1123

merged 1 commit into from
Oct 4, 2016

Conversation

marsam
Copy link
Contributor

@marsam marsam commented Sep 29, 2016

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

@CLAassistant
Copy link

CLAassistant commented Sep 29, 2016

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@swsnr swsnr left a comment

Choose a reason for hiding this comment

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

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))))
Copy link
Contributor

Choose a reason for hiding this comment

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

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

@swsnr
Copy link
Contributor

swsnr commented Sep 29, 2016

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

@marsam
Copy link
Contributor Author

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.

Copy link
Contributor

@swsnr swsnr left a comment

Choose a reason for hiding this comment

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

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))))
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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
Copy link
Contributor Author

marsam commented Sep 30, 2016

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

@swsnr
Copy link
Contributor

swsnr 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
Copy link
Contributor Author

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

@swsnr
Copy link
Contributor

swsnr commented Oct 4, 2016

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

@cpitclaudel
Copy link
Member

LGTM; thanks @marsam!

@cpitclaudel cpitclaudel merged commit 6deaaeb into flycheck:master Oct 4, 2016
@marsam marsam deleted the feature/chicken-syntax-errors branch October 8, 2016 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants