Matterbridge: Add support for a static analysis web service

Created on 23 Oct 2018  路  16Comments  路  Source: 42wim/matterbridge

@Helcaraxan's comment on cyclomatic complexity (https://github.com/42wim/matterbridge/pull/533#issue-224835793) made me realize that my own work would benefit from in-flow updates on how my code is affecting quality metrics :)

After some research, Code Climate still seems to be a front-runner. Here's a sample of what we'd get (some is available in issues):
https://codeclimate.com/github/codeclimate/codeclimate

Open to other suggestions. @42wim, if you enabled Code Climate on the repo, I'd be happy to submit a PR with config

All 16 comments

Good suggestion @patcon ! I had seen various tools but had never stumbled across CodeClimate. Just set it up for my fork of this repo. You can see the results here:

Just looked into it.. codeclimate wants full write and read access to everything on all my repos. That's a bit too greedy.
At first sight it doesn't offer that much more than the standard go linter tools.

True, but I feel it has the same theory of continuous integration: nothing new, just puts it front-and-center and in the middle of conversation, changing the conversation.

Re: permissions. I believe you can author, do the setup, and then revoke auth, no? Code climate should keep working, as it just needs that for setting up the hook

Hmmmm realised that full revocation prevents commit status, which is how code quality gets into each PR convo...

Would you be open to just transferring the repo to https://github.com/matterbridge (which I believe is yours already) and enabling the permission that concerns you?

Alternatively, github has "requested" vs "granted" scopes, because users can revoke piecemeal. You should be able to leave the "repo:status" scope active while revoking the "repo" scope that was used to set up the webhook and key: https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#requested-scopes-and-granted-scopes

Details: https://docs.codeclimate.com/docs/setting-github-oauth-permission-levels

Regardless, I'll submit a PR to get the code climate score badge in the README :)

Did you add codeclimate to your own repo? And can you revoke specific access? because I can't.
Moving the repo to another organization doesn't solve the problem, it just moves it.

But it should be able to do because travis-ci can do this as an app (see screenshot).
Unfortunately the code-climate one doesn't have the free tier option https://github.com/marketplace/code-climate

image

I've also enabled golangci-lint on the repo in travis (https://github.com/42wim/matterbridge/commit/0d64cd8babcec1a54817325adfcc66b4453b3ed1) which does more or less the same as codeclimate but not in a fancy PR window, but the build will fail nevertheless :)

Like for example your latest PR (https://travis-ci.org/42wim/matterbridge/builds/452777072?utm_source=github_status&utm_medium=notification)

Sorry, its not obvious, but they have an app: https://github.com/apps/codeclimate

Wow, how did you find out about this?
Going to https://github.com/apps redirects to https://github.com/marketplace, but your direct link works

heh i just searched "codeclimate github app"

(hadn't found it before your rightful wariness compelled me :) )

Installed now and it has correct permissions 馃憤
image

Seems like checks aren't show up on PR changes though

Have you had a chance to check out the config instructions yet? https://docs.codeclimate.com/docs/github-pull-requests

It might need some yaml files in the repo to configure, but hopefully it has some sensible defaults without :)

Got it working, nothing to configure though

Was this page helpful?
0 / 5 - 0 ratings