Skip to content

Commit 51cb9a1

Browse files
committed
chore: updated, relinted
* updated go version requirement to 1.19, like other go-openapi packages * updated dependencies * updated golangci rules * relinted code * updated README badges and links * ci: updated github actions * ci: remove deprecated appveyor config Signed-off-by: Frederic BIDON <[email protected]>
1 parent 12bfd3b commit 51cb9a1

21 files changed

+292
-275
lines changed

.github/workflows/ci.yaml

-50
This file was deleted.

.github/workflows/go-test.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: go test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-go@v4
12+
with:
13+
go-version: stable
14+
check-latest: true
15+
cache: true
16+
- name: golangci-lint
17+
uses: golangci/golangci-lint-action@v3
18+
with:
19+
version: latest
20+
only-new-issues: true
21+
22+
test:
23+
name: Unit tests
24+
runs-on: ${{ matrix.os }}
25+
26+
strategy:
27+
matrix:
28+
os: [ ubuntu-latest, macos-latest, windows-latest ]
29+
go_version: ['oldstable', 'stable' ]
30+
31+
steps:
32+
- name: Run unit tests
33+
uses: actions/setup-go@v4
34+
with:
35+
go-version: '${{ matrix.go_version }}'
36+
check-latest: true
37+
cache: true
38+
39+
- uses: actions/checkout@v3
40+
41+
- run: go test -v -race -coverprofile="coverage-${{ matrix.os }}.${{ matrix.go_version }}.out" -covermode=atomic ./...
42+
43+
- name: Upload coverage to codecov
44+
uses: codecov/codecov-action@v3
45+
with:
46+
files: './coverage-${{ matrix.os }}.${{ matrix.go_version }}.out'
47+
flags: '${{ matrix.go_version }}'
48+
os: '${{ matrix.os }}'
49+
fail_ci_if_error: false
50+
verbose: true

.golangci.yml

+29-24
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,58 @@ linters-settings:
44
golint:
55
min-confidence: 0
66
gocyclo:
7-
min-complexity: 40
8-
gocognit:
9-
min-complexity: 40
7+
min-complexity: 45
108
maligned:
119
suggest-new: true
1210
dupl:
13-
threshold: 150
11+
threshold: 200
1412
goconst:
1513
min-len: 2
16-
min-occurrences: 4
14+
min-occurrences: 3
1715

1816
linters:
1917
enable-all: true
2018
disable:
2119
- maligned
20+
- unparam
2221
- lll
23-
- gochecknoglobals
2422
- gochecknoinits
25-
# scopelint is useful, but also reports false positives
26-
# that unfortunately can't be disabled. So we disable the
27-
# linter rather than changing code that works.
28-
# see: https://github.com/kyoh86/scopelint/issues/4
29-
- scopelint
23+
- gochecknoglobals
24+
- funlen
3025
- godox
3126
- gocognit
32-
#- whitespace
27+
- whitespace
3328
- wsl
34-
- funlen
35-
- testpackage
3629
- wrapcheck
37-
#- nlreturn
30+
- testpackage
31+
- nlreturn
3832
- gomnd
39-
- goerr113
4033
- exhaustivestruct
41-
#- errorlint
42-
#- nestif
43-
- gofumpt
34+
- goerr113
35+
- errorlint
36+
- nestif
4437
- godot
45-
- gci
46-
- dogsled
38+
- gofumpt
4739
- paralleltest
4840
- tparallel
4941
- thelper
5042
- ifshort
51-
- forbidigo
52-
- cyclop
53-
- varnamelen
5443
- exhaustruct
44+
- varnamelen
45+
- gci
46+
- depguard
47+
- errchkjson
48+
- inamedparam
5549
- nonamedreturns
50+
- musttag
51+
- ireturn
52+
- forcetypeassert
53+
- cyclop
54+
# deprecated linters
55+
- deadcode
56+
- interfacer
57+
- scopelint
58+
- varcheck
59+
- structcheck
60+
- golint
5661
- nosnakecase

README.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# OpenAPI initiative analysis
1+
# OpenAPI analysis [![Build Status](https://github.com/go-openapi/analysis/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/analysis/actions?query=workflow%3A"go+test") [![codecov](https://codecov.io/gh/go-openapi/analysis/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/analysis)
22

3-
[![Build Status](https://travis-ci.org/go-openapi/analysis.svg?branch=master)](https://travis-ci.org/go-openapi/analysis)
4-
[![Build status](https://ci.appveyor.com/api/projects/status/x377t5o9ennm847o/branch/master?svg=true)](https://ci.appveyor.com/project/casualjim/go-openapi/analysis/branch/master)
5-
[![codecov](https://codecov.io/gh/go-openapi/analysis/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/analysis)
63
[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io)
74
[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/analysis/master/LICENSE)
85
[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/analysis.svg)](https://pkg.go.dev/github.com/go-openapi/analysis)
@@ -13,12 +10,12 @@ A foundational library to analyze an OAI specification document for easier reaso
1310

1411
## What's inside?
1512

16-
* A analyzer providing methods to walk the functional content of a specification
13+
* An analyzer providing methods to walk the functional content of a specification
1714
* A spec flattener producing a self-contained document bundle, while preserving `$ref`s
1815
* A spec merger ("mixin") to merge several spec documents into a primary spec
1916
* A spec "fixer" ensuring that response descriptions are non empty
2017

21-
[Documentation](https://godoc.org/github.com/go-openapi/analysis)
18+
[Documentation](https://pkg.go.dev/github.com/go-openapi/analysis)
2219

2320
## FAQ
2421

@@ -28,4 +25,3 @@ A foundational library to analyze an OAI specification document for easier reaso
2825
> This package currently only supports OpenAPI 2.0 (aka Swagger 2.0).
2926
> There is no plan to make it evolve toward supporting OpenAPI 3.x.
3027
> This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story.
31-
>

0 commit comments

Comments
 (0)