hyperoslo / playbook

How we do things, and why
42 stars 8 forks source link

Add code linters/editors to keep code style? #37

Open fespinoza opened 9 years ago

fespinoza commented 9 years ago

in order to have a consistent community driven code style, and to avoid to comment on PR on stuff like: extra lines, unnecessary variables, etc)

should we all install stuff like

rubocop, syntastic for vim and the equivalents for sublime?

timkurvers commented 9 years ago

Rubocop, JSLint, what not :+1:

One of the things we'll have to investigate is how to deal with project styles. I know that most Ruby projects for example do not seem to adhere to the prefer single quotes rule that Rubocop ships with by default. This can be configured, but the question is where we do this.

Should these tools be part of a global install or part of the project? JSLint tends to be added as a development dependency for example. For Ruby I can imagine hooking Rubocop into Guard would be great.

fespinoza commented 9 years ago

for the ruby case I assume that can be a better solution, because shows the dependency explicitly and it's not editor specified

the idea would be then, not to let developer push without make rubocop pass

the configuration we need to see how we do that

ohenrik commented 8 years ago

Btw, i have been using atom with linter-markdown and it works like a charm! Makes your markdown much tidier. :+1:

I'm also using markdown-preview-plus and markdown-preview-plus-opener to use Atom more like a live markdown editor. Can really recommend it!

timkurvers commented 8 years ago

Great find @ohenrik! :+1:

For Sublime, currently using jonschlinkert/sublime-markdown-extended and roadhump/SublimeLinter-contrib-mdl.

fespinoza commented 8 years ago

right now we have linters alternatives for Ruby, JS and Markdown, for Atom, Sublime and Vim :)

timkurvers commented 8 years ago

Unfortunately I jumped the gun on @ohenrik's suggestion of linter-markdown for Atom which uses mdast-lint rather than markdownlint (or mdl) as its linter. Vim and Sublime support mdl, not mdast.