Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: go-openapi/errors
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.19.8
Choose a base ref
...
head repository: go-openapi/errors
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.19.9
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Nov 23, 2020

  1. updated CI config

    * re-enacted linter in CI
    * bumped golang versions used by CI
    * updated golangci settings
    * fixed a few cosmetic linting issues (comments)
    * reduced the matrix of jobs run by CI
    
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi committed Nov 23, 2020
    Copy the full SHA
    539a3d9 View commit details
  2. Merge pull request #28 from fredbi/ci-linting

    updated CI config
    fredbi authored Nov 23, 2020
    Copy the full SHA
    1896884 View commit details
Showing with 48 additions and 13 deletions.
  1. +21 −0 .golangci.yml
  2. +16 −2 .travis.yml
  3. +11 −11 schema_test.go
21 changes: 21 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -18,3 +18,24 @@ linters:
- maligned
- lll
- gochecknoglobals
- godox
- gocognit
- whitespace
- wsl
- funlen
- gochecknoglobals
- gochecknoinits
- scopelint
- wrapcheck
- exhaustivestruct
- exhaustive
- nlreturn
- testpackage
- gci
- gofumpt
- goerr113
- gomnd
- tparallel
- nestif
- godot
- errorlint
18 changes: 16 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
after_success:
- bash <(curl -s https://codecov.io/bash)
go:
- 1.13.x
- 1.14.x
- 1.x
arch:
- amd64
- ppc64le
jobs:
include:
# only run fast tests on ppc64le
- go: 1.x
arch: ppc64le
script:
- gotestsum -f short-verbose -- ./...

# include linting job, but only for latest go version and amd64 arch
- go: 1.x
arch: amd64
install:
go get github.com/golangci/golangci-lint/cmd/golangci-lint
script:
- golangci-lint run --new-from-rev master
install:
- GO111MODULE=off go get -u gotest.tools/gotestsum
language: go
22 changes: 11 additions & 11 deletions schema_test.go
Original file line number Diff line number Diff line change
@@ -351,7 +351,7 @@ func TestSchemaErrors(t *testing.T) {
assert.EqualValues(t, CompositeErrorCode, err2.Code())
assert.Equal(t, "validation failure list:\nfirst error\nsecond error", err2.Error())

//func MultipleOfMustBePositive(name, in string, factor interface{}) *Validation {
// func MultipleOfMustBePositive(name, in string, factor interface{}) *Validation {
err = MultipleOfMustBePositive("path", "body", float64(-10))
assert.Error(t, err)
assert.EqualValues(t, MultipleOfMustBePositiveCode, err.Code())
@@ -368,52 +368,52 @@ func TestSchemaErrors(t *testing.T) {
err = PropertyNotAllowed("path", "body", "key")
assert.Error(t, err)
assert.EqualValues(t, UnallowedPropertyCode, err.Code())
//unallowedProperty = "%s.%s in %s is a forbidden property"
// unallowedProperty = "%s.%s in %s is a forbidden property"
assert.Equal(t, "path.key in body is a forbidden property", err.Error())

err = PropertyNotAllowed("path", "", "key")
assert.Error(t, err)
assert.EqualValues(t, UnallowedPropertyCode, err.Code())
//unallowedPropertyNoIn = "%s.%s is a forbidden property"
// unallowedPropertyNoIn = "%s.%s is a forbidden property"
assert.Equal(t, "path.key is a forbidden property", err.Error())

//func TooManyProperties(name, in string, n int64) *Validation {
// func TooManyProperties(name, in string, n int64) *Validation {
err = TooManyProperties("path", "body", 10)
assert.Error(t, err)
assert.EqualValues(t, TooManyPropertiesCode, err.Code())
//tooManyProperties = "%s in %s should have at most %d properties"
// tooManyProperties = "%s in %s should have at most %d properties"
assert.Equal(t, "path in body should have at most 10 properties", err.Error())

err = TooManyProperties("path", "", 10)
assert.Error(t, err)
assert.EqualValues(t, TooManyPropertiesCode, err.Code())
//tooManyPropertiesNoIn = "%s should have at most %d properties"
// tooManyPropertiesNoIn = "%s should have at most %d properties"
assert.Equal(t, "path should have at most 10 properties", err.Error())

err = TooFewProperties("path", "body", 10)
// func TooFewProperties(name, in string, n int64) *Validation {
assert.Error(t, err)
assert.EqualValues(t, TooFewPropertiesCode, err.Code())
//tooFewProperties = "%s in %s should have at least %d properties"
// tooFewProperties = "%s in %s should have at least %d properties"
assert.Equal(t, "path in body should have at least 10 properties", err.Error())

err = TooFewProperties("path", "", 10)
// func TooFewProperties(name, in string, n int64) *Validation {
assert.Error(t, err)
assert.EqualValues(t, TooFewPropertiesCode, err.Code())
//tooFewPropertiesNoIn = "%s should have at least %d properties"
// tooFewPropertiesNoIn = "%s should have at least %d properties"
assert.Equal(t, "path should have at least 10 properties", err.Error())

//func FailedAllPatternProperties(name, in, key string) *Validation {
// func FailedAllPatternProperties(name, in, key string) *Validation {
err = FailedAllPatternProperties("path", "body", "key")
assert.Error(t, err)
assert.EqualValues(t, FailedAllPatternPropsCode, err.Code())
//failedAllPatternProps = "%s.%s in %s failed all pattern properties"
// failedAllPatternProps = "%s.%s in %s failed all pattern properties"
assert.Equal(t, "path.key in body failed all pattern properties", err.Error())

err = FailedAllPatternProperties("path", "", "key")
assert.Error(t, err)
assert.EqualValues(t, FailedAllPatternPropsCode, err.Code())
//failedAllPatternPropsNoIn = "%s.%s failed all pattern properties"
// failedAllPatternPropsNoIn = "%s.%s failed all pattern properties"
assert.Equal(t, "path.key failed all pattern properties", err.Error())
}