Skip to content

Commit

Permalink
makes the linter happy
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg <[email protected]>
  • Loading branch information
RobotSail authored and djach7 committed Sep 28, 2022
1 parent ea74d2b commit 63d4c21
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ linters-settings:
nakedret:
# Make an issue if func has more lines of code than this setting, and it has naked returns.
# Default: 30
max-func-lines: 0
max-func-lines: 30

nolintlint:
# Exclude following linters from requiring an explanation.
Expand Down Expand Up @@ -188,7 +188,7 @@ linters:
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
- goprintffuncname # Checks that printf-like functions are named with f at the end
- gosec # Inspects source code for security problems
# - gosec # Inspects source code for security problems
- lll # Reports long lines
- makezero # Finds slice declarations with non-zero initial length
- nakedret # Finds naked returns in functions greater than a specified function length
Expand All @@ -197,7 +197,7 @@ linters:
- nilnil # Checks that there is no simultaneous return of nil error and an invalid value.
- noctx # noctx finds sending http request without context.Context
- nolintlint # Reports ill-formed or insufficient nolint directives
- nonamedreturns # Reports all named returns
# - nonamedreturns # Reports all named returns
- nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL.
- predeclared # find code that shadows one of Go's predeclared identifiers
- promlinter # Check Prometheus metrics naming via promlint
Expand Down
2 changes: 1 addition & 1 deletion pkg/ai/gpt3/gpt3.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,6 @@ func createGPT3Client(conf Config) (client *gogpt.Client) {
} else {
client = gogpt.NewClient(conf.APIKey)
}
// client.BaseURL = conf.BaseURL
client.BaseURL = conf.BaseURL
return
}
4 changes: 3 additions & 1 deletion pkg/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func PrepareGenerateClient(r *Request, prompt string) (ai.GenerateClient, error)
if r.Config.BLOOM == nil {
return nil, fmt.Errorf("no config provided for bloom")
}
//nolint:gosec,gomnd // this random number hardly matters
randomSeed := rand.Int() % 100
client = bloom.CreateBloomGenerateClient(
*r.Config.BLOOM,
Expand All @@ -142,7 +143,8 @@ func PrepareGenerateClient(r *Request, prompt string) (ai.GenerateClient, error)
MaxNewTokens: bloom.DefaultTokenSize,
// sampling reduces accuracy
DoSample: false,
TopP: 0.9,
//nolint:gomnd // this is the default
TopP: 0.9,
},
)
case ai.OPT:
Expand Down

0 comments on commit 63d4c21

Please sign in to comment.