diff --git a/internal/result/result.go b/internal/result/result.go index f504b7fc..5efbcb9b 100644 --- a/internal/result/result.go +++ b/internal/result/result.go @@ -274,11 +274,11 @@ func (results Type) JSONReport() string { return string(results.jsonReportRaw()) } -// jsonReportRaw returns the report marshalled into JSON format in byte encoding. +// jsonReportRaw returns the report marshaled into JSON format in byte encoding. func (results Type) jsonReportRaw() []byte { - var marshalledReportBuffer bytes.Buffer - jsonEncoder := json.NewEncoder(io.Writer(&marshalledReportBuffer)) - // By default, the json package HTML-sanitizes strings during marshalling (https://golang.org/pkg/encoding/json/#Marshal) + var marshaledReportBuffer bytes.Buffer + jsonEncoder := json.NewEncoder(io.Writer(&marshaledReportBuffer)) + // By default, the json package HTML-sanitizes strings during marshaling (https://golang.org/pkg/encoding/json/#Marshal) // This means that the simple json.MarshalIndent() approach would result in the report containing gibberish. jsonEncoder.SetEscapeHTML(false) jsonEncoder.SetIndent("", " ") @@ -287,7 +287,7 @@ func (results Type) jsonReportRaw() []byte { panic(fmt.Sprintf("Error while formatting rules report: %v", err)) } - return marshalledReportBuffer.Bytes() + return marshaledReportBuffer.Bytes() } // WriteReport writes a report for all projects to the specified file. diff --git a/internal/rule/schema/parsevalidationresult.go b/internal/rule/schema/parsevalidationresult.go index 1404b0c4..e79fecb0 100644 --- a/internal/rule/schema/parsevalidationresult.go +++ b/internal/rule/schema/parsevalidationresult.go @@ -200,19 +200,19 @@ func validationErrorSchemaSubPointerMatch(schemaPointerRegexp *regexp.Regexp, pa return "" } -// validationErrorSchemaPointerValueMatch marshalls the data in the schema at the given JSON pointer and returns whether +// validationErrorSchemaPointerValueMatch marshals the data in the schema at the given JSON pointer and returns whether // it matches against the given regular expression. func validationErrorSchemaPointerValueMatch( schemaPointerValueRegexp *regexp.Regexp, validationError ValidationResult, schemaPointer string, ) bool { - marshalledSchemaPointerValue, err := json.Marshal(schemaPointerValue(validationError.Result.SchemaURL, schemaPointer, validationError.dataLoader)) + marshaledSchemaPointerValue, err := json.Marshal(schemaPointerValue(validationError.Result.SchemaURL, schemaPointer, validationError.dataLoader)) if err != nil { panic(err) } - logrus.Tracef("Checking schema pointer value: %s match with regexp: %s", marshalledSchemaPointerValue, schemaPointerValueRegexp) - return schemaPointerValueRegexp.Match(marshalledSchemaPointerValue) + logrus.Tracef("Checking schema pointer value: %s match with regexp: %s", marshaledSchemaPointerValue, schemaPointerValueRegexp) + return schemaPointerValueRegexp.Match(marshaledSchemaPointerValue) } // validationErrorContextMatch parses the validation error context data and returns whether it matches against the given diff --git a/poetry.lock b/poetry.lock index c17ac7fb..39deb0bc 100644 --- a/poetry.lock +++ b/poetry.lock @@ -112,20 +112,21 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} [[package]] name = "codespell" -version = "2.2.2" +version = "2.2.4" description = "Codespell" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "codespell-2.2.2-py3-none-any.whl", hash = "sha256:87dfcd9bdc9b3cb8b067b37f0af22044d7a84e28174adfc8eaa203056b7f9ecc"}, - {file = "codespell-2.2.2.tar.gz", hash = "sha256:c4d00c02b5a2a55661f00d5b4b3b5a710fa803ced9a9d7e45438268b099c319c"}, + {file = "codespell-2.2.4-py3-none-any.whl", hash = "sha256:7d984b8130108e6f82524b7d09f8b7bf2fb1e398c5d4b37d9e2bd310145b3e29"}, + {file = "codespell-2.2.4.tar.gz", hash = "sha256:0b4620473c257d9cde1ff8998b26b2bb209a35c2b7489f5dc3436024298ce83a"}, ] [package.extras] -dev = ["check-manifest", "flake8", "pytest", "pytest-cov", "pytest-dependency", "tomli"] +dev = ["Pygments", "build", "chardet", "flake8", "flake8-pyproject", "pytest", "pytest-cov", "pytest-dependency", "tomli"] hard-encoding-detection = ["chardet"] toml = ["tomli"] +types = ["chardet (>=5.1.0)", "mypy", "pytest", "pytest-cov", "pytest-dependency"] [[package]] name = "colorama" @@ -970,4 +971,4 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=4.6)", "pytest-black ( [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "d4d420c017c463ffab92a6e8cb2bdb13227dedea98bb4271eab6a759fee82414" +content-hash = "875418edb31a3a96b64a966d7863010dd9bacc10213c08e40b493707912daa8d" diff --git a/pyproject.toml b/pyproject.toml index 543f991a..40680c75 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ mkdocs-material = "^9.1.2" [tool.poetry.dev-dependencies] black = "^23.1" -codespell = "^2.2.2" +codespell = "^2.2.4" flake8 = "^6.0.0" pep8-naming = "^0.13.3"