Skip to content

Commit

Permalink
This update dependencies module and adds the dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
xuri committed May 27, 2022
1 parent 19a7e03 commit d0446a0
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 48 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 36,7 @@ jobs:
run: go test -v -timeout 60m -coverprofile=coverage.txt -covermode=atomic ./

- name: Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage.txt
Expand Down
3 changes: 0 additions & 3 deletions genC.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 143,6 @@ func (gen *CodeGenerator) CSimpleType(v *SimpleType) {
fieldName := genCFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%stypedef %s;\n", genFieldComment(fieldName, v.Doc, "//"), gen.StructAST[v.Name])
}
return
}

// CComplexType generates code for complex type XML schema in C language
Expand Down Expand Up @@ -192,7 191,6 @@ func (gen *CodeGenerator) CComplexType(v *ComplexType) {
fieldName := genCFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%stypedef %s %s;\n", genFieldComment(fieldName, v.Doc, "//"), gen.StructAST[v.Name], fieldName)
}
return
}

// CGroup generates code for group XML schema in C language syntax.
Expand Down Expand Up @@ -220,7 218,6 @@ func (gen *CodeGenerator) CGroup(v *Group) {
fieldName := genCFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%stypedef %s %s;\n", genFieldComment(fieldName, v.Doc, "//"), gen.StructAST[v.Name], fieldName)
}
return
}

// CAttributeGroup generates code for attribute group XML schema in C language
Expand Down
8 changes: 0 additions & 8 deletions genGo.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 129,6 @@ func genGoFieldType(name string) string {
return "interface{}"
}

var copyright = `// Code generated by xgen. DO NOT EDIT.`

// GoSimpleType generates code for simple type XML schema in Go language
// syntax.
func (gen *CodeGenerator) GoSimpleType(v *SimpleType) {
Expand Down Expand Up @@ -176,7 174,6 @@ func (gen *CodeGenerator) GoSimpleType(v *SimpleType) {
fieldName := genGoFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%stype %s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// GoComplexType generates code for complex type XML schema in Go language
Expand Down Expand Up @@ -241,7 238,6 @@ func (gen *CodeGenerator) GoComplexType(v *ComplexType) {
gen.StructAST[v.Name] = content
gen.Field = fmt.Sprintf("%stype %s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

func isGoBuiltInType(typeName string) bool {
Expand Down Expand Up @@ -278,7 274,6 @@ func (gen *CodeGenerator) GoGroup(v *Group) {
gen.StructAST[v.Name] = content
gen.Field = fmt.Sprintf("%stype %s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// GoAttributeGroup generates code for attribute group XML schema in Go language
Expand All @@ -302,7 297,6 @@ func (gen *CodeGenerator) GoAttributeGroup(v *AttributeGroup) {
gen.StructAST[v.Name] = content
gen.Field = fmt.Sprintf("%stype %s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// GoElement generates code for element XML schema in Go language syntax.
Expand All @@ -317,7 311,6 @@ func (gen *CodeGenerator) GoElement(v *Element) {
fieldName := genGoFieldName(v.Name, false)
gen.Field = fmt.Sprintf("%stype %s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// GoAttribute generates code for attribute XML schema in Go language syntax.
Expand All @@ -332,5 325,4 @@ func (gen *CodeGenerator) GoAttribute(v *Attribute) {
fieldName := genGoFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%stype %s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}
6 changes: 0 additions & 6 deletions genJava.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 136,6 @@ func (gen *CodeGenerator) JavaSimpleType(v *SimpleType) {
fieldName := genJavaFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%s@XmlAccessorType(XmlAccessType.FIELD)\n@XmlAttribute(required = true, name = \"%s\")\npublic class %s {\n%s}\n", genFieldComment(fieldName, v.Doc, "//"), v.Name, fieldName, gen.StructAST[v.Name])
}
return
}

// JavaComplexType generates code for complex type XML schema in Java language
Expand Down Expand Up @@ -190,7 189,6 @@ func (gen *CodeGenerator) JavaComplexType(v *ComplexType) {

gen.Field = fmt.Sprintf("%spublic class %s%s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, typeExtension, gen.StructAST[v.Name])
}
return
}

func isBuiltInJavaType(typeName string) bool {
Expand Down Expand Up @@ -223,7 221,6 @@ func (gen *CodeGenerator) JavaGroup(v *Group) {
fieldName := genJavaFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%spublic class %s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// JavaAttributeGroup generates code for attribute group XML schema in Java language
Expand All @@ -244,7 241,6 @@ func (gen *CodeGenerator) JavaAttributeGroup(v *AttributeGroup) {
fieldName := genJavaFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%spublic class %s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// JavaElement generates code for element XML schema in Java language syntax.
Expand All @@ -258,7 254,6 @@ func (gen *CodeGenerator) JavaElement(v *Element) {
gen.StructAST[v.Name] = content
gen.Field = fmt.Sprintf("\n@XmlAccessorType(XmlAccessType.FIELD)\n@XmlElement(required = true, name = \"%s\")\npublic class %s {\n%s}\n", v.Name, genJavaFieldName(v.Name, true), gen.StructAST[v.Name])
}
return
}

// JavaAttribute generates code for attribute XML schema in Java language syntax.
Expand All @@ -272,5 267,4 @@ func (gen *CodeGenerator) JavaAttribute(v *Attribute) {
gen.StructAST[v.Name] = content
gen.Field = fmt.Sprintf("\n@XmlAccessorType(XmlAccessType.FIELD)\n@XmlAttribute(required = true, name = \"%s\")\npublic class %s {\n%s}\n", v.Name, genJavaFieldName(v.Name, true), gen.StructAST[v.Name])
}
return
}
6 changes: 0 additions & 6 deletions genRust.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 206,6 @@ func (gen *CodeGenerator) RustSimpleType(v *SimpleType) {
fieldName := genRustStructName(v.Name, true)
gen.Field = fmt.Sprintf("\n%s#[derive(Debug, Deserialize, Serialize, PartialEq)]\npub struct %s {\n%s}\n", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// RustComplexType generates code for complex type XML schema in Rust language
Expand Down Expand Up @@ -262,7 261,6 @@ func (gen *CodeGenerator) RustComplexType(v *ComplexType) {
fieldName := genRustStructName(v.Name, true)
gen.Field = fmt.Sprintf("\n%s#[derive(Debug, Deserialize, Serialize, PartialEq)]\npub struct %s {\n%s}\n", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

func isRustBuiltInType(typeName string) bool {
Expand Down Expand Up @@ -296,7 294,6 @@ func (gen *CodeGenerator) RustGroup(v *Group) {
fieldName := genRustStructName(v.Name, true)
gen.Field = fmt.Sprintf("\n%s#[derive(Debug, Deserialize, Serialize, PartialEq)]\npub struct %s {\n%s}\n", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// RustAttributeGroup generates code for attribute group XML schema in Rust language
Expand All @@ -315,7 312,6 @@ func (gen *CodeGenerator) RustAttributeGroup(v *AttributeGroup) {
fieldName := genRustStructName(v.Name, true)
gen.Field = fmt.Sprintf("\n%s#[derive(Debug, Deserialize, Serialize, PartialEq)]\npub struct %s {\n%s}\n", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// RustElement generates code for element XML schema in Rust language syntax.
Expand All @@ -330,7 326,6 @@ func (gen *CodeGenerator) RustElement(v *Element) {
}
gen.Field = fmt.Sprintf("\n%s#[derive(Debug, Deserialize, Serialize, PartialEq)]\npub struct %s {\n%s}\n", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// RustAttribute generates code for attribute XML schema in Rust language syntax.
Expand All @@ -345,5 340,4 @@ func (gen *CodeGenerator) RustAttribute(v *Attribute) {
}
gen.Field = fmt.Sprintf("\n%s#[derive(Debug, Deserialize, Serialize, PartialEq)]\npub struct %s {\n%s}\n", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}
6 changes: 0 additions & 6 deletions genTypeScript.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 139,6 @@ func (gen *CodeGenerator) TypeScriptSimpleType(v *SimpleType) {
fieldName := genTypeScriptFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%sexport type %s =%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// TypeScriptComplexType generates code for complex type XML schema in TypeScript language
Expand Down Expand Up @@ -185,7 184,6 @@ func (gen *CodeGenerator) TypeScriptComplexType(v *ComplexType) {

gen.Field = fmt.Sprintf("%sexport class %s%s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, typeExtension, gen.StructAST[v.Name])
}
return
}

func isBuiltInTypeScriptType(typeName string) bool {
Expand All @@ -210,7 208,6 @@ func (gen *CodeGenerator) TypeScriptGroup(v *Group) {
fieldName := genTypeScriptFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%sexport class %s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// TypeScriptAttributeGroup generates code for attribute group XML schema in TypeScript language
Expand All @@ -230,7 227,6 @@ func (gen *CodeGenerator) TypeScriptAttributeGroup(v *AttributeGroup) {
fieldName := genTypeScriptFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%sexport class %s%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// TypeScriptElement generates code for element XML schema in TypeScript language syntax.
Expand All @@ -240,7 236,6 @@ func (gen *CodeGenerator) TypeScriptElement(v *Element) {
fieldName := genTypeScriptFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%sexport type %s =%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}

// TypeScriptAttribute generates code for attribute XML schema in TypeScript language syntax.
Expand All @@ -250,5 245,4 @@ func (gen *CodeGenerator) TypeScriptAttribute(v *Attribute) {
fieldName := genTypeScriptFieldName(v.Name, true)
gen.Field = fmt.Sprintf("%sexport type %s =%s", genFieldComment(fieldName, v.Doc, "//"), fieldName, gen.StructAST[v.Name])
}
return
}
14 changes: 10 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 1,15 @@
module github.com/xuri/xgen

go 1.14
go 1.15

require (
github.com/stretchr/testify v1.6.1
golang.org/x/net v0.0.0-20200904194848-62affa334b73
golang.org/x/text v0.3.0
github.com/stretchr/testify v1.7.1
golang.org/x/net v0.0.0-20220526153639-5463443f8c37
)

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
18 changes: 6 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 3,12 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF rwdDfMAkV7OtwuqBVzrE8GR6GFx wExME=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0 w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA=
golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW pc6Ldnwhi/IjpwHt7yyuwOQ=
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/net v0.0.0-20220526153639-5463443f8c37 h1:lUkvobShwKsOesNfWWlCS5q7fnbG1MEliIzwu886fn8=
golang.org/x/net v0.0.0-20220526153639-5463443f8c37/go.mod h1:XRhObCWvk6IyKnWLug ECip1KBveYUHfp 8e9klMJ9c=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u 2 /6zg i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
Expand Down
2 changes: 0 additions & 2 deletions schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 16,6 @@ func (opt *Options) prepareLocalNameNSMap(element xml.StartElement) {
opt.LocalNameNSMap[ele.Name.Local] = ele.Value
}
}
return
}

func (opt *Options) prepareNSSchemaLocationMap(element xml.StartElement) {
Expand All @@ -40,7 39,6 @@ func (opt *Options) prepareNSSchemaLocationMap(element xml.StartElement) {
opt.NSSchemaLocationMap[currentNS] = ele.Value
}
}
return
}

func (opt *Options) parseNS(str string) (ns string) {
Expand Down
1 change: 1 addition & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 24,7 @@ import (
)

var (
copyright = "// Code generated by xgen. DO NOT EDIT."
matchFirstCap = regexp.MustCompile("([A-Z])([A-Z][a-z])")
matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])")
fieldNameCount map[string]int
Expand Down

0 comments on commit d0446a0

Please sign in to comment.