Skip to content

Add travis ci#359

Merged
jackycute merged 5 commits intohackmdio:masterfrom
bananaappletw:master
Feb 16, 2017
Merged

Add travis ci#359
jackycute merged 5 commits intohackmdio:masterfrom
bananaappletw:master

Conversation

@bananaappletw
Copy link
Copy Markdown
Contributor

@bananaappletw bananaappletw commented Feb 15, 2017

Add eslint syntax check by travis ci service

@jackycute
Copy link
Copy Markdown
Member

If you like to upgrade the node requirement, please also modify this line:
https://github.com/hackmdio/hackmd/blob/master/package.json#L123

@bananaappletw
Copy link
Copy Markdown
Contributor Author

bananaappletw commented Feb 15, 2017

@jackycute Updated.
Thanks for your reminder.

@a60814billy
Copy link
Copy Markdown
Member

Thanks @bananaappletw ,
Can describe more about this PR ?

@bananaappletw
Copy link
Copy Markdown
Contributor Author

@a60814billy
This pull request add eslint syntax check by travis ci service.
Due to codemirror dependency, upgrade Node dependency to v6.

Copy link
Copy Markdown
Member

@a60814billy a60814billy left a comment

Choose a reason for hiding this comment

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

  1. Consider use make to run eslint or not
  2. modify README.md, test version

Comment thread Makefile Outdated
@@ -0,0 +1,3 @@
lint:
@./node_modules/.bin/eslint .
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe, the script can move to package.json?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@a60814billy For further purpose, we should use Makefile to write test.
It make clearier to write differenct test in Makefile.
Refer: https://github.com/koajs/koa/blob/master/Makefile

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about combine this to webpack? since we already using that.
Seems like only koa use Makefile, maybe it's using Makefile for some other purpose than just lint or test.
I start thinking this is just a preference problem.

Copy link
Copy Markdown
Member

@jackycute jackycute Feb 15, 2017

Choose a reason for hiding this comment

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

And tj himself seems like stop using makefile to run npm scripts in his recent (in an year) repos 😢.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jackycute Ok, I try to use webpack instead.
Thanks.

Comment thread README.md Outdated
---

- Node.js 4.x or up (test up to 6.7.0)
- Node.js 6.x or up (test up to 6.7.0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In travis, already use latest node 7 version to test.
Please modify this line to node 7 latest version.

Copy link
Copy Markdown
Contributor

@SISheogorath SISheogorath Feb 15, 2017

Choose a reason for hiding this comment

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

I think as long as HackMD says it supports node version 6 we should test it. As tests are made to validate possible problems and not have a magic "it should work" somewhere.

Copy link
Copy Markdown
Member

@jackycute jackycute Feb 15, 2017

Choose a reason for hiding this comment

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

Yeah, we'll test the under node 6 version.
Above comment just saying that the "test up to" should be node 7.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@a60814billy I will modify this.
Thanks.

Comment thread .editorconfig Outdated
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab
Copy link
Copy Markdown
Contributor

@SISheogorath SISheogorath Feb 15, 2017

Choose a reason for hiding this comment

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

Mixing up intent styles (even for other file types) is worst you can do and shouldn't be done!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure about this.
I thought different code language might have their best indent that might vary.
Would you explain your intend?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know the importance of consistency.
@bananaappletw what do you think?

Copy link
Copy Markdown
Contributor Author

@bananaappletw bananaappletw Feb 15, 2017

Choose a reason for hiding this comment

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

@SISheogorath @jackycute Tab character has special meaning for Makefile.
So it is correct to use tab indent instead of space in Makefile.
See here
Different programming language has its best intent, agree with that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I personally program most of the time in vim. And the worst thing you can have there is different intent style, than you have in your .vimrc.

In general speaking, you try to find a standard which says tabs or spaces. and also the intent size. Not only for you, for the whole company/project. And as long as you do not configure this in a central config file or a per file config (like possible in vim), you should stay with one type because otherwise you need to create a special config file, per project, per filetype which is more than ugly...

Copy link
Copy Markdown
Contributor Author

@bananaappletw bananaappletw Feb 15, 2017

Choose a reason for hiding this comment

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

@SISheogorath Maybe you have to take a look of this
Tab character has special meaning in Makefile

Copy link
Copy Markdown
Member

@jackycute jackycute Feb 15, 2017

Choose a reason for hiding this comment

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

@SISheogorath Thanks for telling more.
But I think it won't apply to Makefile, because "a tab" indent is part for the format.
It might fail to compile if you don't start line with a tab sometimes (true story).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, I was again misleading myself :D

Thought you edit another file. It's okay :D

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, it is possible to use another character than tabs... but not really useful.

See .RECIPEPREFIX

Comment thread .editorconfig Outdated
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, it is possible to use another character than tabs... but not really useful.

See .RECIPEPREFIX

@SISheogorath
Copy link
Copy Markdown
Contributor

Mhm, someone has to run eslint --fix before this starts to be useful, but this will possibly break all other PRs.

@jackycute
Copy link
Copy Markdown
Member

@SISheogorath yeah, so this PR is more like a pre-setup one.
We'll make the rules more fitting then fix.

Exclude *.min.js from eslint
@bananaappletw
Copy link
Copy Markdown
Contributor Author

I change to use package.json to test lint.
Due to some third library, I add *.min.js as .eslintignore.

@a60814billy a60814billy added this to the 0.6.0 milestone Feb 16, 2017
@a60814billy
Copy link
Copy Markdown
Member

Thanks @bananaappletw ,
we'll merge when making rules fitting our project.

@jackycute
Copy link
Copy Markdown
Member

Let's merge this first, then change the rules when needed.

@jackycute jackycute merged commit 91949be into hackmdio:master Feb 16, 2017
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.

4 participants