Skip to content

Commit

Permalink
fix: address linting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
omissis committed Nov 16, 2024
1 parent d5c4ac8 commit 6e36da2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .rules/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ linters:
- exhaustruct
- forbidigo
- gomnd
- mnd

linters-settings:
decorder:
Expand Down
6 changes: 4 additions & 2 deletions pkg/generator/json_formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ func (jf *jsonFormatter) generate(
declType codegen.TypeDecl,
validators []validator,
) func(*codegen.Emitter) {
var beforeValidators []validator
var afterValidators []validator
var (
beforeValidators []validator
afterValidators []validator
)

forceBefore := false

Expand Down
2 changes: 1 addition & 1 deletion pkg/generator/schema_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ func (g *schemaGenerator) generateTypeInline(t *schemas.Type, scope nameScope) (

if schemas.IsPrimitiveType(t.Type[typeIndex]) {
if t.IsSubSchemaTypeElem() {
return nil, nil
return nil, nil //nolint: nilnil // TODO: this should be fixed, but it requires a refactor.
}

cg, err := codegen.PrimitiveTypeFromJSONSchemaType(
Expand Down
6 changes: 4 additions & 2 deletions pkg/generator/yaml_formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ func (yf *yamlFormatter) generate(
declType codegen.TypeDecl,
validators []validator,
) func(*codegen.Emitter) {
var beforeValidators []validator
var afterValidators []validator
var (
beforeValidators []validator
afterValidators []validator
)

forceBefore := false

Expand Down

0 comments on commit 6e36da2

Please sign in to comment.