From 53258bf989a8d99684662a444ff46a227950188d Mon Sep 17 00:00:00 2001 From: mhmxs Date: Sat, 14 Sep 2019 14:21:16 +0200 Subject: [PATCH] Format source code --- cli/drone/exec/exec.go | 4 ++-- .../pipeline/frontend/yaml/constraint.go | 2 +- .../pipeline/frontend/yaml/types/bool.go | 2 +- cncd/pipeline/pipeline/rpc/client_grpc.go | 2 +- cncd/pipeline/pipeline/rpc/health.go | 2 +- remote/bitbucketserver/convert_test.go | 2 +- remote/gitea/helper_test.go | 2 +- remote/gitea/types.go | 14 +++++++------- remote/github/convert_test.go | 2 +- remote/github/parse_test.go | 2 +- remote/gitlab/gitlab_test.go | 2 +- remote/gitlab/testdata/hooks.go | 6 +++--- remote/gitlab/testdata/oauth.go | 6 +++--- remote/gitlab/testdata/projects.go | 6 +++--- remote/gitlab/testdata/testdata.go | 6 +++--- remote/gitlab/testdata/users.go | 6 +++--- remote/gitlab3/gitlab_test.go | 2 +- remote/gitlab3/testdata/hooks.go | 6 +++--- remote/gitlab3/testdata/oauth.go | 6 +++--- remote/gitlab3/testdata/projects.go | 6 +++--- remote/gitlab3/testdata/testdata.go | 6 +++--- remote/gitlab3/testdata/users.go | 6 +++--- remote/gogs/helper.go | 2 +- remote/gogs/types.go | 16 ++++++++-------- router/middleware/header/header.go | 2 +- router/middleware/remote.go | 2 +- router/middleware/session/agent.go | 2 +- router/middleware/version.go | 2 +- server/file.go | 2 +- server/metrics/prometheus.go | 2 +- server/web/web.go | 2 +- server/z.go | 2 +- store/datastore/repos_test.go | 2 +- store/datastore/users_test.go | 2 +- 34 files changed, 68 insertions(+), 68 deletions(-) diff --git a/cli/drone/exec/exec.go b/cli/drone/exec/exec.go index 1d7388882..d791faa94 100644 --- a/cli/drone/exec/exec.go +++ b/cli/drone/exec/exec.go @@ -11,6 +11,7 @@ import ( "strings" "time" + "github.com/drone/envsubst" "github.com/laszlocph/woodpecker/cncd/pipeline/pipeline" "github.com/laszlocph/woodpecker/cncd/pipeline/pipeline/backend" "github.com/laszlocph/woodpecker/cncd/pipeline/pipeline/backend/docker" @@ -20,7 +21,6 @@ import ( "github.com/laszlocph/woodpecker/cncd/pipeline/pipeline/frontend/yaml/linter" "github.com/laszlocph/woodpecker/cncd/pipeline/pipeline/interrupt" "github.com/laszlocph/woodpecker/cncd/pipeline/pipeline/multipart" - "github.com/drone/envsubst" "github.com/urfave/cli" ) @@ -275,7 +275,7 @@ var Command = cli.Command{ EnvVar: "DRONE_JOB_NUMBER", }, cli.StringSliceFlag{ - Name: "env, e", + Name: "env, e", EnvVar: "DRONE_ENV", }, }, diff --git a/cncd/pipeline/pipeline/frontend/yaml/constraint.go b/cncd/pipeline/pipeline/frontend/yaml/constraint.go index 01dd1f1d8..cee0ca891 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/constraint.go +++ b/cncd/pipeline/pipeline/frontend/yaml/constraint.go @@ -3,9 +3,9 @@ package yaml import ( "path/filepath" + libcompose "github.com/docker/libcompose/yaml" "github.com/laszlocph/woodpecker/cncd/pipeline/pipeline/frontend" "github.com/laszlocph/woodpecker/cncd/pipeline/pipeline/frontend/yaml/types" - libcompose "github.com/docker/libcompose/yaml" ) type ( diff --git a/cncd/pipeline/pipeline/frontend/yaml/types/bool.go b/cncd/pipeline/pipeline/frontend/yaml/types/bool.go index 868ff3b24..17a7aa9af 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/types/bool.go +++ b/cncd/pipeline/pipeline/frontend/yaml/types/bool.go @@ -25,4 +25,4 @@ func (b *BoolTrue) UnmarshalYAML(unmarshal func(interface{}) error) error { // Bool returns the bool value. func (b BoolTrue) Bool() bool { return !b.value -} \ No newline at end of file +} diff --git a/cncd/pipeline/pipeline/rpc/client_grpc.go b/cncd/pipeline/pipeline/rpc/client_grpc.go index 0baca63ae..9e5f78c8d 100644 --- a/cncd/pipeline/pipeline/rpc/client_grpc.go +++ b/cncd/pipeline/pipeline/rpc/client_grpc.go @@ -3,8 +3,8 @@ package rpc import ( "context" "encoding/json" - "time" "log" + "time" "github.com/laszlocph/woodpecker/cncd/pipeline/pipeline/backend" "github.com/laszlocph/woodpecker/cncd/pipeline/pipeline/rpc/proto" diff --git a/cncd/pipeline/pipeline/rpc/health.go b/cncd/pipeline/pipeline/rpc/health.go index 1adc02c1b..c074d7546 100644 --- a/cncd/pipeline/pipeline/rpc/health.go +++ b/cncd/pipeline/pipeline/rpc/health.go @@ -6,6 +6,6 @@ import ( // Health defines a health-check connection. type Health interface { - // Check returns if server is healthy or not + // Check returns if server is healthy or not Check(c context.Context) (bool, error) } diff --git a/remote/bitbucketserver/convert_test.go b/remote/bitbucketserver/convert_test.go index f861ac689..13d6659b1 100644 --- a/remote/bitbucketserver/convert_test.go +++ b/remote/bitbucketserver/convert_test.go @@ -17,9 +17,9 @@ package bitbucketserver import ( "testing" + "github.com/franela/goblin" "github.com/laszlocph/woodpecker/model" "github.com/laszlocph/woodpecker/remote/bitbucketserver/internal" - "github.com/franela/goblin" "github.com/mrjones/oauth" ) diff --git a/remote/gitea/helper_test.go b/remote/gitea/helper_test.go index 7812625de..3ff90ad58 100644 --- a/remote/gitea/helper_test.go +++ b/remote/gitea/helper_test.go @@ -19,9 +19,9 @@ import ( "testing" "code.gitea.io/sdk/gitea" + "github.com/franela/goblin" "github.com/laszlocph/woodpecker/model" "github.com/laszlocph/woodpecker/remote/gitea/fixtures" - "github.com/franela/goblin" ) func Test_parse(t *testing.T) { diff --git a/remote/gitea/types.go b/remote/gitea/types.go index 4f0de583a..f78a679ed 100644 --- a/remote/gitea/types.go +++ b/remote/gitea/types.go @@ -69,13 +69,13 @@ type pullRequestHook struct { Email string `json:"email"` Avatar string `json:"avatar_url"` } `json:"user"` - Title string `json:"title"` - Body string `json:"body"` - State string `json:"state"` - URL string `json:"html_url"` - Mergeable bool `json:"mergeable"` - Merged bool `json:"merged"` - MergeBase string `json:"merge_base"` + Title string `json:"title"` + Body string `json:"body"` + State string `json:"state"` + URL string `json:"html_url"` + Mergeable bool `json:"mergeable"` + Merged bool `json:"merged"` + MergeBase string `json:"merge_base"` Base struct { Label string `json:"label"` Ref string `json:"ref"` diff --git a/remote/github/convert_test.go b/remote/github/convert_test.go index 67b5e3d31..12af5a084 100644 --- a/remote/github/convert_test.go +++ b/remote/github/convert_test.go @@ -17,8 +17,8 @@ package github import ( "testing" - "github.com/laszlocph/woodpecker/model" "github.com/google/go-github/github" + "github.com/laszlocph/woodpecker/model" "github.com/franela/goblin" ) diff --git a/remote/github/parse_test.go b/remote/github/parse_test.go index cc8cd4530..a2c957363 100644 --- a/remote/github/parse_test.go +++ b/remote/github/parse_test.go @@ -19,9 +19,9 @@ import ( "net/http" "testing" + "github.com/franela/goblin" "github.com/laszlocph/woodpecker/model" "github.com/laszlocph/woodpecker/remote/github/fixtures" - "github.com/franela/goblin" ) func Test_parser(t *testing.T) { diff --git a/remote/gitlab/gitlab_test.go b/remote/gitlab/gitlab_test.go index a61687179..150a9c30e 100644 --- a/remote/gitlab/gitlab_test.go +++ b/remote/gitlab/gitlab_test.go @@ -19,9 +19,9 @@ import ( "net/http" "testing" + "github.com/franela/goblin" "github.com/laszlocph/woodpecker/model" "github.com/laszlocph/woodpecker/remote/gitlab/testdata" - "github.com/franela/goblin" ) func Test_Gitlab(t *testing.T) { diff --git a/remote/gitlab/testdata/hooks.go b/remote/gitlab/testdata/hooks.go index ff5ad57bf..ef07684e9 100644 --- a/remote/gitlab/testdata/hooks.go +++ b/remote/gitlab/testdata/hooks.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/testdata/oauth.go b/remote/gitlab/testdata/oauth.go index 6b975e577..4ae0cb5b4 100644 --- a/remote/gitlab/testdata/oauth.go +++ b/remote/gitlab/testdata/oauth.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/testdata/projects.go b/remote/gitlab/testdata/projects.go index eb3cfc397..f51937d28 100644 --- a/remote/gitlab/testdata/projects.go +++ b/remote/gitlab/testdata/projects.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/testdata/testdata.go b/remote/gitlab/testdata/testdata.go index 63db0c4f2..84e4f4542 100644 --- a/remote/gitlab/testdata/testdata.go +++ b/remote/gitlab/testdata/testdata.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/testdata/users.go b/remote/gitlab/testdata/users.go index 247adc9aa..0198fc069 100644 --- a/remote/gitlab/testdata/users.go +++ b/remote/gitlab/testdata/users.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/gitlab_test.go b/remote/gitlab3/gitlab_test.go index 11a761496..99a707f7c 100644 --- a/remote/gitlab3/gitlab_test.go +++ b/remote/gitlab3/gitlab_test.go @@ -19,9 +19,9 @@ import ( "net/http" "testing" + "github.com/franela/goblin" "github.com/laszlocph/woodpecker/model" "github.com/laszlocph/woodpecker/remote/gitlab3/testdata" - "github.com/franela/goblin" ) func Test_Gitlab(t *testing.T) { diff --git a/remote/gitlab3/testdata/hooks.go b/remote/gitlab3/testdata/hooks.go index ff5ad57bf..ef07684e9 100644 --- a/remote/gitlab3/testdata/hooks.go +++ b/remote/gitlab3/testdata/hooks.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/testdata/oauth.go b/remote/gitlab3/testdata/oauth.go index 6b975e577..4ae0cb5b4 100644 --- a/remote/gitlab3/testdata/oauth.go +++ b/remote/gitlab3/testdata/oauth.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/testdata/projects.go b/remote/gitlab3/testdata/projects.go index eb3cfc397..f51937d28 100644 --- a/remote/gitlab3/testdata/projects.go +++ b/remote/gitlab3/testdata/projects.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/testdata/testdata.go b/remote/gitlab3/testdata/testdata.go index d9ea8995a..f197e7197 100644 --- a/remote/gitlab3/testdata/testdata.go +++ b/remote/gitlab3/testdata/testdata.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/testdata/users.go b/remote/gitlab3/testdata/users.go index 247adc9aa..0198fc069 100644 --- a/remote/gitlab3/testdata/users.go +++ b/remote/gitlab3/testdata/users.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gogs/helper.go b/remote/gogs/helper.go index f8d6d1e61..8fe2547fc 100644 --- a/remote/gogs/helper.go +++ b/remote/gogs/helper.go @@ -22,8 +22,8 @@ import ( "strings" "time" - "github.com/laszlocph/woodpecker/model" "github.com/gogits/go-gogs-client" + "github.com/laszlocph/woodpecker/model" ) // helper function that converts a Gogs repository to a Drone repository. diff --git a/remote/gogs/types.go b/remote/gogs/types.go index 9b62c3e28..cd46942dd 100644 --- a/remote/gogs/types.go +++ b/remote/gogs/types.go @@ -68,14 +68,14 @@ type pullRequestHook struct { Email string `json:"email"` Avatar string `json:"avatar_url"` } `json:"user"` - Title string `json:"title"` - Body string `json:"body"` - State string `json:"state"` - URL string `json:"html_url"` - Mergeable bool `json:"mergeable"` - Merged bool `json:"merged"` - MergeBase string `json:"merge_base"` - BaseBranch string `json:"base_branch"` + Title string `json:"title"` + Body string `json:"body"` + State string `json:"state"` + URL string `json:"html_url"` + Mergeable bool `json:"mergeable"` + Merged bool `json:"merged"` + MergeBase string `json:"merge_base"` + BaseBranch string `json:"base_branch"` Base struct { Label string `json:"label"` Ref string `json:"ref"` diff --git a/router/middleware/header/header.go b/router/middleware/header/header.go index 81ed7332f..cfa29e2e7 100644 --- a/router/middleware/header/header.go +++ b/router/middleware/header/header.go @@ -18,8 +18,8 @@ import ( "net/http" "time" - "github.com/laszlocph/woodpecker/version" "github.com/gin-gonic/gin" + "github.com/laszlocph/woodpecker/version" ) // NoCache is a middleware function that appends headers diff --git a/router/middleware/remote.go b/router/middleware/remote.go index ef0233e6a..a7b1f04c4 100644 --- a/router/middleware/remote.go +++ b/router/middleware/remote.go @@ -15,8 +15,8 @@ package middleware import ( - "github.com/laszlocph/woodpecker/remote" "github.com/gin-gonic/gin" + "github.com/laszlocph/woodpecker/remote" ) // Remote is a middleware function that initializes the Remote and attaches to diff --git a/router/middleware/session/agent.go b/router/middleware/session/agent.go index 0fd8f8f96..dba23645f 100644 --- a/router/middleware/session/agent.go +++ b/router/middleware/session/agent.go @@ -15,8 +15,8 @@ package session import ( - "github.com/laszlocph/woodpecker/shared/token" "github.com/gin-gonic/gin" + "github.com/laszlocph/woodpecker/shared/token" ) // AuthorizeAgent authorizes requsts from build agents to access the queue. diff --git a/router/middleware/version.go b/router/middleware/version.go index 02c0c6217..a7b7c6bc6 100644 --- a/router/middleware/version.go +++ b/router/middleware/version.go @@ -15,8 +15,8 @@ package middleware import ( - "github.com/laszlocph/woodpecker/version" "github.com/gin-gonic/gin" + "github.com/laszlocph/woodpecker/version" ) // Version is a middleware function that appends the Drone version information diff --git a/server/file.go b/server/file.go index b7cbfe60c..efa497761 100644 --- a/server/file.go +++ b/server/file.go @@ -20,9 +20,9 @@ import ( "strconv" "strings" + "github.com/gin-gonic/gin" "github.com/laszlocph/woodpecker/router/middleware/session" "github.com/laszlocph/woodpecker/store" - "github.com/gin-gonic/gin" ) // FileList gets a list file by build. diff --git a/server/metrics/prometheus.go b/server/metrics/prometheus.go index c2ecaecb1..9f6dbb01c 100644 --- a/server/metrics/prometheus.go +++ b/server/metrics/prometheus.go @@ -18,8 +18,8 @@ import ( "errors" "fmt" - "github.com/laszlocph/woodpecker/server" "github.com/gin-gonic/gin" + "github.com/laszlocph/woodpecker/server" "github.com/prometheus/client_golang/prometheus/promhttp" ) diff --git a/server/web/web.go b/server/web/web.go index db42511a1..43e322b66 100644 --- a/server/web/web.go +++ b/server/web/web.go @@ -24,10 +24,10 @@ import ( "path/filepath" "time" + "github.com/laszlocph/woodpecker-ui/dist" "github.com/laszlocph/woodpecker/model" "github.com/laszlocph/woodpecker/shared/token" "github.com/laszlocph/woodpecker/version" - "github.com/laszlocph/woodpecker-ui/dist" "github.com/dimfeld/httptreemux" ) diff --git a/server/z.go b/server/z.go index 32949fbd7..6dd9ea5f2 100644 --- a/server/z.go +++ b/server/z.go @@ -15,9 +15,9 @@ package server import ( + "github.com/gin-gonic/gin" "github.com/laszlocph/woodpecker/store" "github.com/laszlocph/woodpecker/version" - "github.com/gin-gonic/gin" ) // Health endpoint returns a 500 if the server state is unhealthy. diff --git a/store/datastore/repos_test.go b/store/datastore/repos_test.go index 0ef77e068..9f7b909a3 100644 --- a/store/datastore/repos_test.go +++ b/store/datastore/repos_test.go @@ -17,8 +17,8 @@ package datastore import ( "testing" - "github.com/laszlocph/woodpecker/model" "github.com/franela/goblin" + "github.com/laszlocph/woodpecker/model" ) func TestRepos(t *testing.T) { diff --git a/store/datastore/users_test.go b/store/datastore/users_test.go index 2bcf2575d..7ba76c9d0 100644 --- a/store/datastore/users_test.go +++ b/store/datastore/users_test.go @@ -17,8 +17,8 @@ package datastore import ( "testing" - "github.com/laszlocph/woodpecker/model" "github.com/franela/goblin" + "github.com/laszlocph/woodpecker/model" ) func TestUsers(t *testing.T) {