Skip to content

Commit 9da2f26

Browse files
authored
Merge pull request #38 from PDOK/wr/linting
linting todos
2 parents 7402a37 + 40c519d commit 9da2f26

File tree

16 files changed

+37
-12
lines changed

16 files changed

+37
-12
lines changed

api/v2beta1/shared_conversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func ConvertOptionsV3ToV2(src pdoknlv3.Options) WMSWFSOptions {
3636
}
3737
}
3838

39+
//nolint:gosec
3940
func ConvertAutoscaling(src Autoscaling) *pdoknlv3.HorizontalPodAutoscalerPatch {
4041
var minReplicas *int32
4142
if src.MinReplicas != nil {

api/v2beta1/wfs_conversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func (src *WFS) ConvertTo(dstRaw conversion.Hub) error {
4545
return src.ToV3(dst)
4646
}
4747

48+
//nolint:gosec
4849
func (src *WFS) ToV3(dst *pdoknlv3.WFS) error {
4950
dst.ObjectMeta = src.ObjectMeta
5051

api/v2beta1/wms_conversion.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func (src *WMS) ConvertTo(dstRaw conversion.Hub) error {
4949
return nil
5050
}
5151

52+
//nolint:gosec
5253
func (src *WMS) ToV3(target *pdoknlv3.WMS) {
5354
dst := target
5455

@@ -424,9 +425,11 @@ func (v2Layer WMSLayer) MapToV3(v2Service WMSService) pdoknlv3.Layer {
424425
return layer
425426
}
426427

428+
//nolint:cyclop
427429
func mapV3LayerToV2Layers(v3Layer pdoknlv3.Layer, parent *pdoknlv3.Layer, serviceEPSG string) []WMSLayer {
428430
var layers []WMSLayer
429431

432+
//nolint:nestif
430433
if parent == nil && v3Layer.Name == nil {
431434
// Default top layer, do not include in v2 layers
432435
if v3Layer.Layers != nil {

api/v3/wfs_validation.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func (wfs *WFS) ValidateCreate() ([]string, error) {
3030
wfs.Name, allErrs)
3131
}
3232

33+
// TODO fix linting (dupl)
3334
func (wfs *WFS) ValidateUpdate(wfsOld *WFS) ([]string, error) {
3435
warnings := []string{}
3536
allErrs := field.ErrorList{}

api/v3/wms_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ func (wms *WMS) URLPath() string {
564564
func (wms *WMS) GeoPackages() []*Gpkg {
565565
gpkgs := make([]*Gpkg, 0)
566566

567+
// TODO fix linting (nestif)
567568
if wms.Spec.Service.Layer.Layers != nil {
568569
for _, layer := range wms.Spec.Service.Layer.Layers {
569570
if layer.Data != nil {

api/v3/wms_validation.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func (wms *WMS) ValidateCreate() ([]string, error) {
3232
wms.Name, allErrs)
3333
}
3434

35+
// TODO fix linting (dupl)
3536
func (wms *WMS) ValidateUpdate(wmsOld *WMS) ([]string, error) {
3637
warnings := []string{}
3738
allErrs := field.ErrorList{}
@@ -55,6 +56,7 @@ func (wms *WMS) ValidateUpdate(wmsOld *WMS) ([]string, error) {
5556
wms.Name, allErrs)
5657
}
5758

59+
// TODO fix linting (cyclop)
5860
func ValidateWMS(wms *WMS, warnings *[]string, allErrs *field.ErrorList) {
5961
if strings.Contains(wms.GetName(), "wms") {
6062
sharedValidation.AddWarning(
@@ -220,6 +222,7 @@ func ValidateWMS(wms *WMS, warnings *[]string, allErrs *field.ErrorList) {
220222
}
221223
}
222224

225+
// TODO fix linting (nestif)
223226
if layer.Visible {
224227
hasVisibleLayer = true
225228

cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func init() {
7878
// +kubebuilder:scaffold:scheme
7979
}
8080

81-
//nolint:gocyclo
81+
// TODO fix linting (cyclop)
8282
func main() {
8383
var metricsAddr string
8484
var certDir string

config/crd/update_openapi.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func main() {
1818
updateWMSV3Layers(crdDir)
1919
}
2020

21+
// TODO fix linting (funlen)
2122
func updateWMSV3Layers(crdDir string) {
2223
path := filepath.Join(crdDir, "pdok.nl_wms.yaml")
2324

internal/controller/capabilitiesgenerator/mapper.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ func mapServiceProvider(provider *smoothoperatorv1.ServiceProvider) (serviceProv
165165
}
166166
}
167167

168+
// TODO fix linting (nestif)
168169
if provider.ServiceContact != nil {
169170
serviceProvider.ServiceContact = &wfs200.ServiceContact{
170171
IndividualName: provider.ServiceContact.IndividualName,
@@ -360,6 +361,7 @@ func getDcpType(url string, fillPost bool) *wms130.DCPType {
360361
return &result
361362
}
362363

364+
// TODO fix linting (funlen)
363365
func getLayers(wms *pdoknlv3.WMS, canonicalURL string) []wms130.Layer {
364366
result := make([]wms130.Layer, 0)
365367
referenceLayer := wms.Spec.Service.Layer

internal/controller/mapfilegenerator/mapper.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ func MapWMSToMapfileGeneratorInput(wms *pdoknlv3.WMS, _ *smoothoperatorv1.OwnerI
220220
return result, nil
221221
}
222222

223+
// TODO fix linting (cyclop)
223224
func getWMSLayer(serviceLayer pdoknlv3.Layer, serviceExtent string, wms *pdoknlv3.WMS) WMSLayer {
224225
layerExtent := serviceExtent
225226
if len(serviceLayer.BoundingBoxes) > 0 {

0 commit comments

Comments
 (0)