@@ -17,7 +17,7 @@ The preferred solution, in this case, is to inject the `bus` into services or ta
...
@@ -17,7 +17,7 @@ The preferred solution, in this case, is to inject the `bus` into services or ta
### settings package
### settings package
In the `setting` packages there are many global variables which Grafana sets at startup. This is also something we want to move
In the `setting` packages there are many global variables which Grafana sets at startup. This is also something we want to move
away from and move as much configuration as possible to the `setting.Cfg` struct and pass the around just like the bus
away from and move as much configuration as possible to the `setting.Cfg` struct and pass it around, just like the bus.
## Linting and formatting
## Linting and formatting
We enforce strict `gofmt` formating and use some linters on our codebase. You can find the current list of linters at https://github.com/grafana/grafana/blob/master/scripts/gometalinter.sh#L23
We enforce strict `gofmt` formating and use some linters on our codebase. You can find the current list of linters at https://github.com/grafana/grafana/blob/master/scripts/gometalinter.sh#L23
...
@@ -27,4 +27,4 @@ We don't enforce `golint` but we encourage it and we will test so the number of
...
@@ -27,4 +27,4 @@ We don't enforce `golint` but we encourage it and we will test so the number of
## Testing
## Testing
We use GoConvey for BDD/scenario based testing. Which we think is useful for testing certain chain or interactions. Ex https://github.com/grafana/grafana/blob/master/pkg/services/auth/auth_token_test.go
We use GoConvey for BDD/scenario based testing. Which we think is useful for testing certain chain or interactions. Ex https://github.com/grafana/grafana/blob/master/pkg/services/auth/auth_token_test.go
For smaller tests its preferred to use standard library testing.
For smaller tests its preferred to use standard library testing.