Skip to content

Commit 4e3fbd6

Browse files
authored
Merge pull request #57 from PDOK/basim/remove-linting
remove linting
2 parents aaf495d + 660cb86 commit 4e3fbd6

51 files changed

Lines changed: 368 additions & 534 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.golangci.yml

Lines changed: 0 additions & 129 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ogc-specifications
2-
[![Lint](https://github.com/PDOK/ogc-specifications/actions/workflows/lint.yml/badge.svg)](https://github.com/PDOK/ogc-specifications/actions/workflows/lint.yml)
2+
33
![GitHub license](https://img.shields.io/github/license/PDOK/ogc-specifications)
44
[![GitHub
55
release](https://img.shields.io/github/release/PDOK/ogc-specifications.svg)](https://github.com/PDOK/ogc-specifications/releases)

pkg/utils/xml.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,35 @@ type XMLAttribute []xml.Attr
99

1010
// StripDuplicateAttr removes the duplicate Attributes from a []Attribute
1111
func StripDuplicateAttr(attr []xml.Attr) []xml.Attr {
12-
attributeMap := make(map[xml.Name]string)
12+
attributemap := make(map[xml.Name]string)
1313
for _, a := range attr {
14-
attributeMap[xml.Name{Space: a.Name.Space, Local: a.Name.Local}] = a.Value
14+
attributemap[xml.Name{Space: a.Name.Space, Local: a.Name.Local}] = a.Value
1515
}
1616

1717
var strippedAttr []xml.Attr
18-
for k, v := range attributeMap {
18+
for k, v := range attributemap {
1919
strippedAttr = append(strippedAttr, xml.Attr{Name: k, Value: v})
2020
}
2121
return strippedAttr
2222
}
2323

2424
// UnmarshalXML func for the XMLAttr struct
2525
func (xmlattr *XMLAttribute) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
26-
var newAttributes XMLAttribute
26+
var newattributes XMLAttribute
2727
for _, attr := range start.Attr {
28-
newAttributes = append(newAttributes, xml.Attr{Name: attr.Name, Value: attr.Value})
28+
switch attr.Name.Local {
29+
default:
30+
newattributes = append(newattributes, xml.Attr{Name: attr.Name, Value: attr.Value})
31+
}
2932
}
30-
*xmlattr = newAttributes
33+
*xmlattr = newattributes
3134

3235
for {
3336
// if it got this far the XML is 'valid' and the xmlattr are set
3437
// so we ignore the err
3538
token, _ := d.Token()
36-
37-
if el, ok := token.(xml.EndElement); ok {
39+
switch el := token.(type) {
40+
case xml.EndElement:
3841
if el == start.End() {
3942
return nil
4043
}

pkg/wcs201/capabilities.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package wcs201
22

33
// ParseXML func
4-
func (c *Capabilities) ParseXML(_ []byte) error {
4+
func (c *Capabilities) ParseXML(doc []byte) error {
55
return nil
66
}
77

88
// ParseYAML func
9-
func (c *Capabilities) ParseYAML(_ []byte) error {
9+
func (c *Capabilities) ParseYAML(doc []byte) error {
1010
return nil
1111
}
1212

pkg/wcs201/getcapabilities_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (gc *GetCapabilitiesRequest) Type() string {
2323
}
2424

2525
// Validate validates the GetCapabilities struct
26-
func (gc *GetCapabilitiesRequest) Validate(_ Capabilities) []wsc200.Exception {
26+
func (gc *GetCapabilitiesRequest) Validate(c Capabilities) []wsc200.Exception {
2727
return nil
2828
}
2929

pkg/wfs200/capabilities.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@ package wfs200
22

33
import (
44
"encoding/xml"
5-
65
"github.com/pdok/ogc-specifications/pkg/wsc110"
76
)
87

98
// ParseXML func
10-
func (c *Capabilities) ParseXML(_ []byte) error {
9+
func (c *Capabilities) ParseXML(doc []byte) error {
1110
return nil
1211
}
1312

1413
// ParseYAML func
15-
func (c *Capabilities) ParseYAML(_ []byte) error {
14+
func (c *Capabilities) ParseYAML(doc []byte) error {
1615
return nil
1716
}
1817

@@ -165,7 +164,7 @@ type MetadataHref struct {
165164
// FilterCapabilities struct for the WFS 2.0.0
166165
type FilterCapabilities struct {
167166
Conformance Conformance `xml:"fes:Conformance" yaml:"conformance"`
168-
IDCapabilities IDCapabilities `xml:"fes:Id_Capabilities" yaml:"idCapabilities"`
167+
IDCapabilities IdCapabilities `xml:"fes:Id_Capabilities" yaml:"idCapabilities"`
169168
ScalarCapabilities ScalarCapabilities `xml:"fes:Scalar_Capabilities" yaml:"scalarCapabilities"`
170169
SpatialCapabilities SpatialCapabilities `xml:"fes:Spatial_Capabilities" yaml:"spatialCapabilities"`
171170
// NO TemporalCapabilities!!!
@@ -177,8 +176,8 @@ type Conformance struct {
177176
Constraint []ValueConstraint `xml:"fes:Constraint" yaml:"constraint"`
178177
}
179178

180-
// IDCapabilities struct for the WFS 2.0.0
181-
type IDCapabilities struct {
179+
// IdCapabilities struct for the WFS 2.0.0
180+
type IdCapabilities struct {
182181
ResourceIdentifier ResourceIdentifier `xml:"fes:ResourceIdentifier" yaml:"resourceIdentifier"`
183182
}
184183

pkg/wfs200/crs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const (
1111

1212
// CRS struct with namespace/authority/registry and code
1313
type CRS struct {
14-
Namespace string // TODO maybe AuthorityType is a better name...?
14+
Namespace string //TODO maybe AuthorityType is a better name...?
1515
Code int
1616
}
1717

pkg/wfs200/crs_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ othercrs:
5151
err := yaml.Unmarshal(test.yaml, &ftl)
5252
if err != nil {
5353
t.Errorf("test: %d, yaml.UnMarshal failed with '%s'\n", k, err)
54-
} else if ftl.DefaultCRS.Code != test.expectedcrs.Code || ftl.DefaultCRS.Namespace != test.expectedcrs.Namespace {
55-
t.Errorf("test: %d, expected: %v+,\n got: %v+", k, test.expectedcrs, ftl.DefaultCRS)
54+
} else {
55+
if ftl.DefaultCRS.Code != test.expectedcrs.Code || ftl.DefaultCRS.Namespace != test.expectedcrs.Namespace {
56+
t.Errorf("test: %d, expected: %v+,\n got: %v+", k, test.expectedcrs, ftl.DefaultCRS)
57+
}
5658
}
5759
}
5860
}
@@ -68,11 +70,13 @@ func TestMarshalYAMLCrs(t *testing.T) {
6870
}
6971
for k, test := range tests {
7072
yamlCRS, err := yaml.Marshal(test.CRS)
71-
7273
if err != nil {
7374
t.Errorf("test: %d, yaml.Marshal failed with '%s'\n", k, err)
74-
} else if stringCRS := string(yamlCRS); stringCRS != test.expectedYAML {
75-
t.Errorf("test: %d, expected: %v+,\n got: %v+", k, test.expectedYAML, stringCRS)
75+
} else {
76+
stringCRS := string(yamlCRS)
77+
if stringCRS != test.expectedYAML {
78+
t.Errorf("test: %d, expected: %v+,\n got: %v+", k, test.expectedYAML, stringCRS)
79+
}
7680
}
7781
}
7882
}

pkg/wfs200/describefeaturetype_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func (d DescribeFeatureTypeRequest) Type() string {
2121
}
2222

2323
// Validate returns GetCapabilities
24-
func (d DescribeFeatureTypeRequest) Validate(_ wsc110.Capabilities) []wsc110.Exception {
24+
func (d DescribeFeatureTypeRequest) Validate(c wsc110.Capabilities) []wsc110.Exception {
2525
return nil
2626
}
2727

0 commit comments

Comments
 (0)