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

[RDY] Remove jade checker and replace it with pug checker #1084

Merged
merged 1 commit into from
Sep 15, 2016

Conversation

robbyoconnor
Copy link
Contributor

@robbyoconnor robbyoconnor commented Sep 12, 2016

This removes the jade checker and adds the a checker for pug.

Closes GH-951

@CLAassistant
Copy link

CLAassistant commented Sep 12, 2016

CLA assistant check
All committers have signed the CLA.

@robbyoconnor
Copy link
Contributor Author

robbyoconnor commented Sep 12, 2016

@flycheck/maintainers @lunaryorn

@cpitclaudel
Copy link
Member

Thanks, looks great :) (LGTM) Could you add a news entry, too?

@cpitclaudel
Copy link
Member

(maybe the news entry should mention that the patterns have been updated, too?)

@robbyoconnor
Copy link
Contributor Author

I'll fix the formatting snafu hold on

@robbyoconnor
Copy link
Contributor Author

robbyoconnor commented Sep 12, 2016

I'll fix that. Gotta let them know that this won't work as a drop-in for Jade. Do I need to update the texi file too in lagacy?

@robbyoconnor robbyoconnor force-pushed the add-pug-mode-checker branch 3 times, most recently from e9b5395 to 6e6e189 Compare September 12, 2016 21:21
@robbyoconnor
Copy link
Contributor Author

robbyoconnor commented Sep 12, 2016

I added f as a dependency in the Cask file. It broke make format without it.

@robbyoconnor
Copy link
Contributor Author

robbyoconnor commented Sep 12, 2016

Hold off -- I'm gonna keep the jade checker -- by using the pug checker...

@@ -19,13 +19,13 @@
(depends-on "d-mode")
(depends-on "erlang")
(depends-on "ess")
(depends-on "f")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this line. Look above, f is already there…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It failed for me...

@swsnr
Copy link
Contributor

swsnr commented Sep 12, 2016

@robbyoconnor Thanks a lot for your contribution.

Please don't keep the jade checker, though. If jade is deprecated there's no reason for us to keep it. Users that still depend on jade should either stick to an older version of Flycheck or manually resurrect the jade checker in their configuration.

There are also a couple of minor issues in the PR. Please address these and rebase onto master.

Thanks 👍

@robbyoconnor robbyoconnor force-pushed the add-pug-mode-checker branch 8 times, most recently from f35a212 to 58abe05 Compare September 12, 2016 22:12
@robbyoconnor
Copy link
Contributor Author

All green! 💚


- New syntax checkers:

- Elixir with ``dogma`` [GH-969]
- sass and scss with ``sass-lint`` [GH-1070]
- pug [GH-951] [GH-1084]
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be either capitalized or wrapped in backticks, no?

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 can fix that.

(zero-or-more not-newline) "at "
(zero-or-more not-newline) " line " line)

;; syntax/runtime errors
Copy link
Member

Choose a reason for hiding this comment

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

This scares me a bit: what kind of errors do you have in mind when you mention "runtime errors"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me fix that wording.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

runtime errors (e.g., type errors -- which aren't syntax errors)

Copy link
Contributor Author

@robbyoconnor robbyoconnor Sep 15, 2016

Choose a reason for hiding this comment

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

runtime error

TypeError: /home/rob/flycheck/test/resources/language/pug/pug-runtime-error.pug:5
    3|   head
    4|     body
  > 5|     = foo.bar
    6| 

Cannot read property 'bar' of undefined
    at eval (eval at wrap (/home/rob/.nvm/versions/node/v5.12.0/lib/node_modules/pug-cli/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:13:60)
    at template (eval at wrap (/home/rob/.nvm/versions/node/v5.12.0/lib/node_modules/pug-cli/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:13:137)
    at ReadStream.<anonymous> (/home/rob/.nvm/versions/node/v5.12.0/lib/node_modules/pug-cli/index.js:230:20)
    at emitNone (events.js:85:20)
    at ReadStream.emit (events.js:179:7)
    at endReadableNT (_stream_readable.js:913:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)```

Copy link
Contributor Author

@robbyoconnor robbyoconnor Sep 15, 2016

Choose a reason for hiding this comment

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

Not really a syntax error, more of a type error and yes these errors are verbose as hell and not fun to write regexps for...but...i've managed to make do :)

@robbyoconnor robbyoconnor force-pushed the add-pug-mode-checker branch 2 times, most recently from 922b9a0 to a619704 Compare September 15, 2016 03:54
@robbyoconnor robbyoconnor reopened this Sep 15, 2016
@robbyoconnor
Copy link
Contributor Author

Sorry(triggering a CI build)

@robbyoconnor
Copy link
Contributor Author

Build failures aren't my fault if they occur...seems travis times out

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.

Thanks for the changes. There are couple of stylistic issues left, and the tests need to be split into individual test cases.

((error "Error: " (message) (zero-or-more not-newline) "\n"
(zero-or-more not-newline) "at "
(zero-or-more not-newline) " line " line)

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this blank line.

(zero-or-more not-newline) "\n") (zero-or-more not-newline) "\n"
(message) line-end))


Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this blank lines as well.

@@ -3547,6 +3543,17 @@ Why not:
"language/processing/syntax_error/syntax_error.pde" 'processing-mode
'(4 2 error "Syntax error, maybe a missing semicolon?"
:checker processing)))
(flycheck-ert-def-checker-test pug pug nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a blank line above.

(flycheck-ert-should-syntax-check
"language/pug/pug.pug" 'pug-mode
'(2 1 error "unexpected token \"indent\"" :checker pug))
(flycheck-ert-should-syntax-check
Copy link
Contributor

Choose a reason for hiding this comment

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

Please split the test into multiple test cases. There should only be one -ert-should-syntax-check call per -ert-def-checker-test.

The 3rd argument—which is nil currently—let's you change give a name to each checker test.

@@ -1,6 +1,6 @@
doctype html
html
head
title Jade Examples
title Pug Examples
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move this file into the pug/ directory to put it beneath all the other pug files.

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 thought i did... weird

(one-or-more (and (zero-or-more not-newline) "|"
(zero-or-more not-newline) "\n"))
(zero-or-more not-newline) "\n" (message) line-end))
:modes jade-mode)

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this blank line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What? There is no blank line here...

Copy link
Contributor

Choose a reason for hiding this comment

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

You removed the code only but no adjacent blank line, so there were to blank lines between the previous and the next checker now. Looks fixed in the current diff.

@robbyoconnor
Copy link
Contributor Author

robbyoconnor commented Sep 15, 2016

Made the changes.

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.

Another bunch of minor style issues and typos, but other than that LGTM. Please fix those and I'll merge.

Thanks a lot for this contributions. Awesome work!

((error "Error: " (message) (zero-or-more not-newline) "\n"
(zero-or-more not-newline) "at "
(zero-or-more not-newline) " line " line)
;; syntax/runtime errors(e.g, type errors)
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a space missing before the opening parenthesis, and the comma after e.g should be a dot :)

:command ("pug" "-p" (eval (expand-file-name (buffer-file-name))))
:standard-input t
:error-patterns
;; errors with includes/extends (e.g., missing files)
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a redundant comma

(flycheck-ert-should-syntax-check
"language/pug/pug-extends.pug" 'pug-mode
'(1 nil error
"the \"basedir\" option is required to use includes and extends with \"absolute\" paths" :checker pug)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move the message to the line before, and instead break before :checker. That's how we did it in the other tests, I find that it's easier to read this way.

@swsnr
Copy link
Contributor

swsnr commented Sep 15, 2016

LGTM, because LGTM.co didn't seem to catch the review comment.

@robbyoconnor robbyoconnor force-pushed the add-pug-mode-checker branch 3 times, most recently from 17fd914 to 515efb3 Compare September 15, 2016 10:36
@robbyoconnor
Copy link
Contributor Author

Additional changes have been made.

Jade is now deprecated and is replaced by pug. I do not feel it is
worth while to maintain a checker for both.

Closes flycheckGH-951
@swsnr swsnr merged commit 2875c63 into flycheck:master Sep 15, 2016
@swsnr
Copy link
Contributor

swsnr commented Sep 15, 2016

Many many thanks 👍

@robbyoconnor robbyoconnor deleted the add-pug-mode-checker branch September 15, 2016 19:40
@swsnr swsnr mentioned this pull request Sep 16, 2016
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