Skip to content

Commit

Permalink
Merge pull request GoogleCloudPlatform#495 from GoogleCloudPlatform/u…
Browse files Browse the repository at this point in the history
…pdate-dependency

update dependency + add linters
  • Loading branch information
sergeylanzman authored May 2, 2020
2 parents 8957ff7 + 2bbd0f5 commit 42780d7
Show file tree
Hide file tree
Showing 74 changed files with 630 additions and 1,932 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/reviewdog.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on:
push:
branches:
- master
pull_request:
branches:
- master
name: linter + tests
jobs:
test:
strategy:
matrix:
go-version: [1.14.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: go test ./...
linter:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.github_token }}
tool_name: golangci-lint
73 changes: 73 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This file contains all available configuration options
# with their default values.

# options for analysis running
run:
# default concurrency is a available CPU number
concurrency: 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 30m
# exit code when at least one issue was found, default is 1
issues-exit-code: 1

# which dirs to skip: issues from them won't be reported;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but default dirs are skipped independently
# from this option's value (see skip-dirs-use-default).
skip-dirs:

# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true

# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:

# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
modules-download-mode: readonly


# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true

# print linter name in the end of issue text, default is true
print-linter-name: true

# make issues output unique by line, default is true
uniq-by-line: true
linters:
enable:
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
- gofmt
#- gomnd
#- gosec
#- golint
- goimports
#- gocritic
#- wsl
#- whitespace
fast: false
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

19 changes: 15 additions & 4 deletions build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ func main() {
}
}
// move files for deleted providers
os.MkdirAll(packageCmdPath+"/tmp", os.ModePerm)
err = os.MkdirAll(packageCmdPath+"/tmp", os.ModePerm)
if err != nil {
log.Println(err)
}
for _, provider := range deletedProvider {
err := os.Rename(packageCmdPath+"/"+filePrefix+provider+fileSuffix, packageCmdPath+"/tmp/"+filePrefix+provider+fileSuffix)
if err != nil {
Expand All @@ -42,6 +45,9 @@ func main() {

// comment deleted providers in code
rootCode, err := ioutil.ReadFile(packageCmdPath + "/root.go")
if err != nil {
log.Println(err)
}
lines := strings.Split(string(rootCode), "\n")
newRootCodeLines := make([]string, len(lines))
for i, line := range lines {
Expand All @@ -56,8 +62,10 @@ func main() {
newRootCodeLines[i] = line
}
newRootCode := strings.Join(newRootCodeLines, "\n")
ioutil.WriteFile(packageCmdPath+"/root.go", []byte(newRootCode), os.ModePerm)

err = ioutil.WriteFile(packageCmdPath+"/root.go", []byte(newRootCode), os.ModePerm)
if err != nil {
log.Println(err)
}
// build....
cmd := exec.Command("go", "build", "-o", "terraformer-"+provider)
var outb, errb bytes.Buffer
Expand All @@ -70,7 +78,10 @@ func main() {
fmt.Println(outb.String())

//revert code and files
ioutil.WriteFile(packageCmdPath+"/root.go", []byte(rootCode), os.ModePerm)
err = ioutil.WriteFile(packageCmdPath+"/root.go", []byte(rootCode), os.ModePerm)
if err != nil {
log.Println(err)
}
for _, provider := range deletedProvider {
err := os.Rename(packageCmdPath+"/tmp/"+filePrefix+provider+fileSuffix, "cmd/"+filePrefix+provider+fileSuffix)
if err != nil {
Expand Down
102 changes: 32 additions & 70 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,93 +3,55 @@ module github.com/GoogleCloudPlatform/terraformer
go 1.14

require (
cloud.google.com/go v0.50.0
cloud.google.com/go v0.56.0
cloud.google.com/go/logging v1.0.0
cloud.google.com/go/storage v1.4.0
github.com/Azure/azure-sdk-for-go v37.2.0+incompatible
github.com/Azure/go-autorest/autorest v0.9.3
github.com/Azure/go-autorest/autorest/adal v0.8.1 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 // indirect
cloud.google.com/go/storage v1.6.0
github.com/Azure/azure-sdk-for-go v42.0.0+incompatible
github.com/Azure/go-autorest/autorest v0.10.0
github.com/OctopusDeploy/go-octopusdeploy v1.6.0
github.com/ajg/form v1.5.1 // indirect
github.com/aliyun/alibaba-cloud-sdk-go v1.60.295
github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5 // indirect
github.com/aliyun/aliyun-tablestore-go-sdk v4.1.3+incompatible
github.com/aws/aws-sdk-go v1.26.5
github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible
github.com/aws/aws-sdk-go v1.30.19
github.com/aws/aws-sdk-go-v2 v0.22.0
github.com/bmatcuk/doublestar v1.2.2 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cloudflare/cloudflare-go v0.11.0
github.com/cloudflare/cloudflare-go v0.11.7
github.com/ddelnano/terraform-provider-mikrotik v0.0.0-20200501162830-a217572b326c
github.com/denverdino/aliyungo v0.0.0-20191217032211-d5785803c365
github.com/digitalocean/godo v1.29.0
github.com/denverdino/aliyungo v0.0.0-20200327235253-d59c209c7e93
github.com/digitalocean/godo v1.35.1
github.com/dollarshaveclub/new-relic-synthetics-go v0.0.0-20170605224734-4dc3dd6ae884
github.com/fastly/go-fastly v1.7.0
github.com/go-resty/resty v0.0.0-00010101000000-000000000000 // indirect
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect
github.com/fastly/go-fastly v1.10.0
github.com/google/go-github/v25 v25.1.3
github.com/google/jsonapi v0.0.0-20181016150055-d0428f63eb51 // indirect
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/gophercloud/gophercloud v0.7.0
github.com/gophercloud/gophercloud v0.10.0
github.com/hashicorp/go-azure-helpers v0.10.0
github.com/hashicorp/go-hclog v0.10.1
github.com/hashicorp/go-plugin v1.0.1
github.com/hashicorp/go-retryablehttp v0.6.4 // indirect
github.com/hashicorp/go-hclog v0.12.2
github.com/hashicorp/go-plugin v1.2.2
github.com/hashicorp/hcl v1.0.0
github.com/hashicorp/hcl/v2 v2.2.0
github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 // indirect
github.com/hashicorp/terraform v0.12.18
github.com/hashicorp/terraform-svchost v0.0.0-20191119180714-d2e4933b9136 // indirect
github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d // indirect
github.com/hashicorp/terraform v0.12.24
github.com/heroku/heroku-go/v5 v5.1.0
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af
github.com/jmespath/go-jmespath v0.3.0
github.com/jonboydell/logzio_client v1.2.0
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/labd/commercetools-go-sdk v0.0.0-20200309143931-ca72e918a79d
github.com/linode/linodego v0.12.2
github.com/mattn/go-isatty v0.0.11 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200413144118-2212afc81161
github.com/paultyng/go-newrelic v3.1.0+incompatible // indirect
github.com/linode/linodego v0.15.0
github.com/mrparkers/terraform-provider-keycloak v0.0.0-20200430145754-86b13691768d
github.com/paultyng/go-newrelic/v4 v4.10.0
github.com/pkg/errors v0.8.1
github.com/posener/complete v1.2.3 // indirect
github.com/spf13/cobra v0.0.5
github.com/pkg/errors v0.9.1
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
github.com/ulikunitz/xz v0.5.6 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vultr/govultr v0.1.7
github.com/zclconf/go-cty v1.2.1
github.com/zorkian/go-datadog-api v2.25.0+incompatible
go.opencensus.io v0.22.2 // indirect
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6
golang.org/x/sys v0.0.0-20191218084908-4a24b4065292 // indirect
github.com/vultr/govultr v0.4.0
github.com/zclconf/go-cty v1.4.0
github.com/zorkian/go-datadog-api v2.29.0+incompatible
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/text v0.3.2
gonum.org/v1/gonum v0.6.1
google.golang.org/api v0.15.0
google.golang.org/appengine v1.6.5 // indirect
google.golang.org/genproto v0.0.0-20191216205247-b31c10ee225f
google.golang.org/grpc v1.26.0 // indirect
gopkg.in/ini.v1 v1.51.0 // indirect
gopkg.in/resty.v0 v0.4.1 // indirect
k8s.io/api v0.17.0 // indirect
k8s.io/apimachinery v0.17.0
k8s.io/client-go v0.0.0-20191003000419-f68efa97b39e
gonum.org/v1/gonum v0.7.0
google.golang.org/api v0.22.0
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84
gopkg.in/jarcoal/httpmock.v1 v1.0.0-00010101000000-000000000000 // indirect
k8s.io/apimachinery v0.17.5
k8s.io/client-go v0.17.5
k8s.io/utils v0.0.0-20191218082557-f07c713de883 // indirect
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e // indirect
)

// related to invalid pseudo-version: does not match version-control timestamp (2019-04-09T20:28:23Z)
replace golang.org/x/lint => golang.org/x/lint v0.0.0-20190409202823-959b441ac422

replace golang.org/x/time => golang.org/x/time v0.0.0-20190308202827-9d24e82272b4

replace github.com/go-resty/resty => gopkg.in/resty.v1 v1.11.0

replace git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999 => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999

replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.0.0+incompatible

// https://stackoverflow.com/questions/55537287/unexpected-module-path-github-com-sirupsen-logrus
replace github.com/Sirupsen/logrus => github.com/sirupsen/logrus v1.0.6
replace gopkg.in/jarcoal/httpmock.v1 => github.com/jarcoal/httpmock v1.0.5
Loading

0 comments on commit 42780d7

Please sign in to comment.