matrix-org / matrix-federation-tester

Tester for matrix federation written in golang.
78 stars 17 forks source link

Fix CI/linting #55

Closed babolivier closed 5 years ago

babolivier commented 5 years ago

I realised that in previous PRs the CI would show no error/warning on the current configuration, even though there are linting errors in the code.

babolivier commented 5 years ago

So the reason it was not finding anything is because gometalinter looks for *.go files in the directory it's run from, which was the root of the repository. This explains why #46 makes the CI go unhappy, since that's where it moves the code.

In addition to that, it also needed an alternate GOPATH that includes the repo's root and the vendor directory in order for it to find dependencies and the main package correctly.

Might be worth noting that making gocyclo happy involved moving all of the connection report to a different function. We might want to just ignore gocyclo on the Report function instead in order to keep the changes as small as possible.

Regarding handling of errors, not sure about what we want to do there, so I just added some logging.