Skip to content

Commit

Permalink
chore: clean old code
Browse files Browse the repository at this point in the history
  • Loading branch information
azrod committed Sep 17, 2024
1 parent 2bcd3a4 commit 1e72bc5
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 176 deletions.
6 changes: 2 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ linters:
- gochecknoinits # Checks that no init functions are present in Go code [fast: true, auto-fix: false]
- gocognit # Computes and checks the cognitive complexity of functions [fast: true, auto-fix: false]
- godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false]
- err113 # Golang linter to check the errors handling expressions [fast: false, auto-fix: false]
- gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false]
- lll # Reports long lines [fast: true, auto-fix: false]
- maintidx # maintidx measures the maintainability index of each function. [fast: true, auto-fix: false]
Expand Down Expand Up @@ -116,9 +115,8 @@ linters-settings:
# Choose whether to use the extra rules.
# Default: false
extra-rules: true

revive:
revive:
ignore-generated-header: true
severity: error
rules:
Expand All @@ -133,7 +131,7 @@ linters-settings:
disabled: false
arguments:
# List Bypass rules
- []
- []
# List force rules
- [
# Default rules
Expand Down
32 changes: 22 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,30 @@ repos:
rev: v4.6.0
hooks:
- id: check-merge-conflict
# - id: trailing-whitespace
# - id: end-of-file-fixer
- id: trailing-whitespace
exclude: >
(?x)^(
docs/|
templates/|
)$
- id: end-of-file-fixer
- id: forbid-submodules

# ## GOLANG
# - repo: https://github.com/tekwizely/pre-commit-golang
# rev: v1.0.0-rc.1
# hooks:
# - id: go-vet
# - id: go-imports-repo
# - id: golangci-lint-repo-pkg
# - id: go-mod-tidy-repo
## GOLANG
- repo: https://github.com/golangci/golangci-lint
rev: v1.61.0
hooks:
- id: golangci-lint
entry: bash -c 'exec golangci-lint run -j=6'

- repo: local
hooks:
- id: gomod
name: gomod
entry: .pre-commit/go-mod
language: script
files: go.mod
pass_filenames: false

## GIT
- repo: https://github.com/compilerla/conventional-pre-commit
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit/go-mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
#
# go mod tidy will alter go.mod or go.sum if it finds any discrepancies
#

go mod tidy
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ require (
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0
github.com/iancoleman/strcase v0.3.0
github.com/kr/pretty v0.3.1
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.12.0
github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339
github.com/orange-cloudavenue/infrapi-sdk-go v0.1.4-0.20231005074857-89878ea119fb
github.com/rs/zerolog v1.33.0
github.com/thanhpk/randstr v1.0.6
github.com/vmware/go-vcloud-director/v2 v2.25.0
Expand All @@ -44,7 +42,6 @@ require (
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/ajg/form v1.5.1 // indirect
github.com/antihax/optional v1.0.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de // indirect
github.com/armon/go-radix v1.0.0 // indirect
Expand Down Expand Up @@ -85,6 +82,7 @@ require (
github.com/influxdata/influxdb-client-go/v2 v2.12.3 // indirect
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
Expand Down Expand Up @@ -112,7 +110,6 @@ require (
go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
Expand Down
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7l
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
Expand Down Expand Up @@ -254,8 +252,6 @@ github.com/orange-cloudavenue/cloudavenue-sdk-go v0.12.0 h1:7Sr4vhlbxU3uu3aKDCa+
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.12.0/go.mod h1:6ybGMCq1vVjPNgxXFK0lD1vCrvAUyXMP66VKGNOLXs0=
github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339 h1:DEKcWLGbEhu/I6kn9NAXhVCFrbPhR+Ef7oLmpLVnnPM=
github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339/go.mod h1:11JAFfGWVmhoT4AAORKsIC5M6nI+uDGSEOScMzavgPA=
github.com/orange-cloudavenue/infrapi-sdk-go v0.1.4-0.20231005074857-89878ea119fb h1:1/Wc21Tp9RnDOUTjKBm9x3wi+UgUkDc2bv0fHJc5f2o=
github.com/orange-cloudavenue/infrapi-sdk-go v0.1.4-0.20231005074857-89878ea119fb/go.mod h1:pGa9mB6s+weCi5QtNe5nicp7yL0C/e+i+3wHRh4cjBE=
github.com/peterhellberg/link v1.2.0 h1:UA5pg3Gp/E0F2WdX7GERiNrPQrM1K6CVJUUWfHa4t6c=
github.com/peterhellberg/link v1.2.0/go.mod h1:gYfAh+oJgQu2SrZHg5hROVRQe1ICoK0/HHJTcE0edxc=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
Expand Down Expand Up @@ -348,8 +344,6 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ=
golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down
3 changes: 0 additions & 3 deletions internal/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"os"
"testing"

"github.com/kr/pretty"

clientca "github.com/orange-cloudavenue/cloudavenue-sdk-go"
clientcloudavenue "github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/clients/cloudavenue"
caverror "github.com/orange-cloudavenue/cloudavenue-sdk-go/pkg/errors"
Expand Down Expand Up @@ -106,7 +104,6 @@ func TestCloudAvenueClient(t *testing.T) {
_, err := c.New()
if tt.wantErr {
if err == nil {
t.Log(pretty.Sprint(err))
t.Errorf("expected error: %v", tt.expectedErr)
return
}
Expand Down
97 changes: 0 additions & 97 deletions internal/helpers/api_errors.go

This file was deleted.

19 changes: 0 additions & 19 deletions internal/helpers/auth.go

This file was deleted.

26 changes: 0 additions & 26 deletions internal/helpers/auth_test.go

This file was deleted.

7 changes: 0 additions & 7 deletions internal/helpers/config.go

This file was deleted.

0 comments on commit 1e72bc5

Please sign in to comment.