It would be amazing if a similar static code analysis tool existed with settings to conform to the most popular javascript style guides: npm, idiomatic, jQuery, etc. But even within these style guides there is a lot of 'undefined behavior', or situations that aren't explicitly described in the guides.
RuboCop – A Ruby static code analyzer
11–20 of 39 posts
Re: RuboCop – A Ruby static code analyzer
#12Rubocop is an absolute pleasure to work with, but it also helps that the ruby community seems to have a more widely-agreed upon style guide than other communities (Javascript comes to mind). There are similar tools for Javascript, and I imagine many of them are configurable as well to cover most use cases. But with the diversity of Javascript style guides and the lack of cohesiveness in the js community, it seems unl…
It's not configurable, is a drop-in executable tool and supports a --format option which will attempt to reformat your code. To me it seems to be inspired by gofmt.
Re: RuboCop – A Ruby static code analyzer
#13Rubocop is an absolute pleasure to work with, but it also helps that the ruby community seems to have a more widely-agreed upon style guide than other communities (Javascript comes to mind). There are similar tools for Javascript, and I imagine many of them are configurable as well to cover most use cases. But with the diversity of Javascript style guides and the lack of cohesiveness in the js community, it seems unl…
This is starting to pick up steam in the node community, and represents the coding style of a vast percentage of core and popular npm modules: https://github.com/feross/standard It's not configurable, is a drop-in executable tool and supports a --format option which will attempt to reformat your code. To me it seems to be inspired by gofmt.
The auto-formatting option does not clarify which of these it enforces, and one of these isn't even a style rule (always handle the err parameter in node.js).
To really rub it in, it also makes it very clear that there is no configuration! Deal with it in a way that strikes me as uncomfortably smug.
I appreciate you sharing, and I could see this being useful for running over a codebase. I might use it to convert all tabs to double spaces (since that's my preference anyway) and check to make sure there are no unused declared variables, but that might be the extent of it. But to be honest, reading the documentation here has made me really want to see a community-developed tool inspired by Rubocop.
Re: RuboCop – A Ruby static code analyzer
#14Rubocop is an absolute pleasure to work with, but it also helps that the ruby community seems to have a more widely-agreed upon style guide than other communities (Javascript comes to mind). There are similar tools for Javascript, and I imagine many of them are configurable as well to cover most use cases. But with the diversity of Javascript style guides and the lack of cohesiveness in the js community, it seems unl…
This is starting to pick up steam in the node community, and represents the coding style of a vast percentage of core and popular npm modules: https://github.com/feross/standard It's not configurable, is a drop-in executable tool and supports a --format option which will attempt to reformat your code. To me it seems to be inspired by gofmt.
Re: RuboCop – A Ruby static code analyzer
#15Is there a way to have RuboCop automatically clean up things it detects? Obviously I would run this one file at a time, and git diff it before committing it.
Re: RuboCop – A Ruby static code analyzer
#16Earlier quoted context omitted.
This is starting to pick up steam in the node community, and represents the coding style of a vast percentage of core and popular npm modules: https://github.com/feross/standard It's not configurable, is a drop-in executable tool and supports a --format option which will attempt to reformat your code. To me it seems to be inspired by gofmt.
Looks pretty cool, but it supports a very limited set of styles. It's not really comparable to rubocop, nor is it able to enforce conformance to any of the popular style guides in full. In fact, at a glance it appears to make decisions about your code that fly in the face of many of the popular style guides (double spaces for indentation and no freaking semicolons [seriously?]). The auto-formatting option does not cl…
If you want more control, use ESlint or jslint or jshint and define your own rules.
Re: RuboCop – A Ruby static code analyzer
#17Earlier quoted context omitted.
This is starting to pick up steam in the node community, and represents the coding style of a vast percentage of core and popular npm modules: https://github.com/feross/standard It's not configurable, is a drop-in executable tool and supports a --format option which will attempt to reformat your code. To me it seems to be inspired by gofmt.
Looks cool except for the no semi colons thing. The first time I spend fifteen minutes searching for why this weird bug was happening only to realize it was because of ASI, that shit is going in the trash.
Re: RuboCop – A Ruby static code analyzer
#18Earlier quoted context omitted.
Looks pretty cool, but it supports a very limited set of styles. It's not really comparable to rubocop, nor is it able to enforce conformance to any of the popular style guides in full. In fact, at a glance it appears to make decisions about your code that fly in the face of many of the popular style guides (double spaces for indentation and no freaking semicolons [seriously?]). The auto-formatting option does not cl…
That there is no configuration is kind of the point. Close the door on the bike shed and attempt to popularize a conventional style. If you want more control, use ESlint or jslint or jshint and define your own rules.