diff --git a/.golangci.yaml b/.golangci.yaml index a3c45a9..9d9b85b 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -6,7 +6,7 @@ linters-settings: lll: line-length: 128 goimports: - local-prefixes: "github.com/AislingHPE" + local-prefixes: "github.com/HewlettPackard" godox: keywords: - OPTIMIZE @@ -43,7 +43,6 @@ linters: - errchkjson - errname - errorlint - - execinquery - exhaustive - exportloopref - funlen diff --git a/Makefile b/Makefile index 29231cb..f67a8a6 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +# Copyright 2024 Hewlett Packard Enterprise Development LP + .PHONY: test test: go test ./... diff --git a/cmd/cmd.go b/cmd/cmd.go index cf31905..a7f75b4 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package cmd import ( @@ -8,7 +9,7 @@ import ( "github.com/spf13/cobra" - "github.com/AislingHPE/terraschema/pkg/jsonschema" + "github.com/HewlettPackard/terraschema/pkg/jsonschema" ) // wanted behaviour: diff --git a/go.mod b/go.mod index ed741b5..817da7e 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/AislingHPE/terraschema +module github.com/HewlettPackard/terraschema go 1.21.6 diff --git a/main.go b/main.go index c85c1ce..dd7880a 100644 --- a/main.go +++ b/main.go @@ -1,10 +1,11 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package main import ( "fmt" "os" - "github.com/AislingHPE/terraschema/cmd" + "github.com/HewlettPackard/terraschema/cmd" ) func main() { diff --git a/pkg/jsonschema/json-schema.go b/pkg/jsonschema/json-schema.go index f0d8b11..9f103a1 100644 --- a/pkg/jsonschema/json-schema.go +++ b/pkg/jsonschema/json-schema.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package jsonschema import ( @@ -5,8 +6,8 @@ import ( "fmt" "slices" - "github.com/AislingHPE/terraschema/pkg/model" - "github.com/AislingHPE/terraschema/pkg/reader" + "github.com/HewlettPackard/terraschema/pkg/model" + "github.com/HewlettPackard/terraschema/pkg/reader" ) func CreateSchema(path string, strict bool) (map[string]any, error) { diff --git a/pkg/jsonschema/json-schema_test.go b/pkg/jsonschema/json-schema_test.go index 121cf6b..f12c605 100644 --- a/pkg/jsonschema/json-schema_test.go +++ b/pkg/jsonschema/json-schema_test.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package jsonschema import ( diff --git a/pkg/jsonschema/type.go b/pkg/jsonschema/type.go index aff6882..19d67f4 100644 --- a/pkg/jsonschema/type.go +++ b/pkg/jsonschema/type.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package jsonschema import ( diff --git a/pkg/jsonschema/validation.go b/pkg/jsonschema/validation.go index 2bae487..ce1c72c 100644 --- a/pkg/jsonschema/validation.go +++ b/pkg/jsonschema/validation.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package jsonschema import ( diff --git a/pkg/jsonschema/validation_util.go b/pkg/jsonschema/validation_util.go index 400b4eb..95e5184 100644 --- a/pkg/jsonschema/validation_util.go +++ b/pkg/jsonschema/validation_util.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package jsonschema import ( diff --git a/pkg/jsonschema/value.go b/pkg/jsonschema/value.go index fb9ee79..8d571c0 100644 --- a/pkg/jsonschema/value.go +++ b/pkg/jsonschema/value.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package jsonschema import ( diff --git a/pkg/jsonschema/value_test.go b/pkg/jsonschema/value_test.go index 7f1691a..8fdccd8 100644 --- a/pkg/jsonschema/value_test.go +++ b/pkg/jsonschema/value_test.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package jsonschema import ( @@ -10,7 +11,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" - "github.com/AislingHPE/terraschema/pkg/reader" + "github.com/HewlettPackard/terraschema/pkg/reader" ) func TestExpressionToJSONObject_Default(t *testing.T) { diff --git a/pkg/model/model.go b/pkg/model/model.go index 6dcb93a..4e87f5e 100644 --- a/pkg/model/model.go +++ b/pkg/model/model.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package model import ( diff --git a/pkg/reader/reader.go b/pkg/reader/reader.go index c65af2e..e5ca428 100644 --- a/pkg/reader/reader.go +++ b/pkg/reader/reader.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package reader import ( @@ -8,7 +9,7 @@ import ( "github.com/hashicorp/hcl/v2/gohcl" "github.com/hashicorp/hcl/v2/hclparse" - "github.com/AislingHPE/terraschema/pkg/model" + "github.com/HewlettPackard/terraschema/pkg/model" ) var fileSchema = &hcl.BodySchema{ diff --git a/pkg/reader/reader_test.go b/pkg/reader/reader_test.go index d3fa718..7ab0c2f 100644 --- a/pkg/reader/reader_test.go +++ b/pkg/reader/reader_test.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package reader import ( diff --git a/pkg/reader/type-constraint_test.go b/pkg/reader/type-constraint_test.go index 491e1bb..fca5ed8 100644 --- a/pkg/reader/type-constraint_test.go +++ b/pkg/reader/type-constraint_test.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package reader import ( diff --git a/pkg/reader/type-contraint.go b/pkg/reader/type-contraint.go index 52e6e31..9cb1e0c 100644 --- a/pkg/reader/type-contraint.go +++ b/pkg/reader/type-contraint.go @@ -1,3 +1,4 @@ +// (C) Copyright 2024 Hewlett Packard Enterprise Development LP package reader import ( diff --git a/test/modules/complex-types/variables.tf b/test/modules/complex-types/variables.tf index 4122f39..14a1254 100644 --- a/test/modules/complex-types/variables.tf +++ b/test/modules/complex-types/variables.tf @@ -1,3 +1,5 @@ +# Copyright 2024 Hewlett Packard Enterprise Development LP + variable "an_object_with_optional" { type = object({ a = string diff --git a/test/modules/custom-validation/variables.tf b/test/modules/custom-validation/variables.tf index e39d331..52ddf7a 100644 --- a/test/modules/custom-validation/variables.tf +++ b/test/modules/custom-validation/variables.tf @@ -1,3 +1,5 @@ +# Copyright 2024 Hewlett Packard Enterprise Development LP + variable "a_string_enum_kind_1" { type = string default = "a" diff --git a/test/modules/simple-types/no-variables.tf b/test/modules/simple-types/no-variables.tf index e69de29..0834a09 100644 --- a/test/modules/simple-types/no-variables.tf +++ b/test/modules/simple-types/no-variables.tf @@ -0,0 +1 @@ +# Copyright 2024 Hewlett Packard Enterprise Development LP \ No newline at end of file diff --git a/test/modules/simple-types/other-variables.tf b/test/modules/simple-types/other-variables.tf index 2b481b8..592773c 100644 --- a/test/modules/simple-types/other-variables.tf +++ b/test/modules/simple-types/other-variables.tf @@ -1,3 +1,5 @@ +# Copyright 2024 Hewlett Packard Enterprise Development LP + variable "a_variable_in_another_file" { type = string description = "a string" diff --git a/test/modules/simple-types/variables.tf b/test/modules/simple-types/variables.tf index f8a0b3b..d491798 100644 --- a/test/modules/simple-types/variables.tf +++ b/test/modules/simple-types/variables.tf @@ -1,3 +1,5 @@ +# Copyright 2024 Hewlett Packard Enterprise Development LP + variable "a_string" { type = string default = "a string" diff --git a/test/modules/simple/main.tf b/test/modules/simple/main.tf index 6add732..ae5613c 100644 --- a/test/modules/simple/main.tf +++ b/test/modules/simple/main.tf @@ -1,3 +1,5 @@ +# Copyright 2024 Hewlett Packard Enterprise Development LP + terraform { required_version = ">= 0.13.0" } diff --git a/test/modules/simple/sub-module/variables.tf b/test/modules/simple/sub-module/variables.tf index 9c52108..e198c9d 100644 --- a/test/modules/simple/sub-module/variables.tf +++ b/test/modules/simple/sub-module/variables.tf @@ -1,3 +1,5 @@ +# Copyright 2024 Hewlett Packard Enterprise Development LP + variable "should_be_ignored" { type = string description = "Variables in sub-modules are not read." diff --git a/test/modules/simple/variables.tf b/test/modules/simple/variables.tf index a85e73c..4973e84 100644 --- a/test/modules/simple/variables.tf +++ b/test/modules/simple/variables.tf @@ -1,3 +1,5 @@ +# Copyright 2024 Hewlett Packard Enterprise Development LP + variable "name" { type = string description = "Your name." diff --git a/test/modules/simple/wrong-file-type.hcl b/test/modules/simple/wrong-file-type.hcl index a23ef31..b08c96f 100644 --- a/test/modules/simple/wrong-file-type.hcl +++ b/test/modules/simple/wrong-file-type.hcl @@ -1,3 +1,5 @@ +# Copyright 2024 Hewlett Packard Enterprise Development LP + variable "a_variable_in_the_wrong_file" { type = string description = "A string. This should not show up in the schema, and is ignored by terraform."