Live data from Hacker News

Linthub: Static code analysis for GitHub pull requests

linthub.io

21–30 of 35 posts

Re: Linthub: Static code analysis for GitHub pull requests

#21
post #19
post #11

Earlier quoted context omitted.

This is exactly why we've develop this. To enforce code quality to pull requests and save the repository owners time.

I think he's commenting on the approach of how the system reports, not its usefulness. Have you considered bundling up the results as a second commit status[1] rather than making comments? 1: https://github.com/blog/1935-see-results-from-all-pull-reque...

Adding a commit status would be nice. It'd fail whilst the most recent commit has had a commit-comment on it.

Re: Linthub: Static code analysis for GitHub pull requests

#24
post #19

Earlier quoted context omitted.

I think he's commenting on the approach of how the system reports, not its usefulness. Have you considered bundling up the results as a second commit status[1] rather than making comments? 1: https://github.com/blog/1935-see-results-from-all-pull-reque...

Adding a commit status would be nice. It'd fail whilst the most recent commit has had a commit-comment on it.

The commit status have been added :-).

Re: Linthub: Static code analysis for GitHub pull requests

#25
post #9

Instead of using a service like this one (or Hound) that comments directly on pull requests, we chose to integrate the same tools in our build process with Phare ( https://github.com/mirego/phare ), a command-line tool we built which runs Rubocop, JSHint, JSCS, etc. and exits with a global status. If the code has coding style violations, the build breaks. Exactly like it would if we pushed a failing test. Personally,…

+1 for "lint errors fail the build"

If you also add "and any coding style things you care about, you have to make the linter check for", then you don't have to waste any time on that stuff in the pull request.

Re: Linthub: Static code analysis for GitHub pull requests

#26
post #25
post #9

Instead of using a service like this one (or Hound) that comments directly on pull requests, we chose to integrate the same tools in our build process with Phare ( https://github.com/mirego/phare ), a command-line tool we built which runs Rubocop, JSHint, JSCS, etc. and exits with a global status. If the code has coding style violations, the build breaks. Exactly like it would if we pushed a failing test. Personally,…

+1 for "lint errors fail the build" If you also add "and any coding style things you care about, you have to make the linter check for", then you don't have to waste any time on that stuff in the pull request.

GitLab B.V. CEO here. Totally agree that lint errors should fail the build instead of commenting. Otherwise all the people /cc't in the pull/merge request get all the hound comments in their email. And the nice thing about Rubocop https://github.com/bbatsov/rubocop is that you can disable tests easily. With GitLab we initially had: 406 files inspected, 1609 offenses detected. But after selecting only the most important checks and a day of fixing we got a green build.

Re: Linthub: Static code analysis for GitHub pull requests

#27

Similar services: https://houndci.com/ http://scrutinizer-ci.com/ http://landscape.io/ http://codeclimate.com/

Does anyone know how these services stack up against each other? I use CodeClimate and it rocks, but I'm curious about how the others work.

Re: Linthub: Static code analysis for GitHub pull requests

#28
post #9

Instead of using a service like this one (or Hound) that comments directly on pull requests, we chose to integrate the same tools in our build process with Phare ( https://github.com/mirego/phare ), a command-line tool we built which runs Rubocop, JSHint, JSCS, etc. and exits with a global status. If the code has coding style violations, the build breaks. Exactly like it would if we pushed a failing test. Personally,…

There's an obvious trade-off here, though. For example, why stop at basic lint-style checks? You could make a static analyzer part of the build process and fail the build when a defect is detected. The trade-off is the same as with growing a test suite that always runs: Over time, your build times increase, and that makes development tedious.

There's a balance to be found between core checks that run at build time, and additional, more extensive checks, which run automatically and asynchronously (!) once a developer believes their changes to be good enough. Both things have their place in a proper software development flow.

Re: Linthub: Static code analysis for GitHub pull requests

#29
post #27

Similar services: https://houndci.com/ http://scrutinizer-ci.com/ http://landscape.io/ http://codeclimate.com/

Does anyone know how these services stack up against each other? I use CodeClimate and it rocks, but I'm curious about how the others work.

I may be biased as I made Landscape.io, but it rocks too!
Post reply on HN