mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-10 16:55:40 +00:00
enable nolintlint linter
This commit is contained in:
parent
13628660c1
commit
4634ce10b0
@ -13,6 +13,7 @@ linters:
|
||||
- megacheck
|
||||
- misspell
|
||||
- nakedret
|
||||
- nolintlint
|
||||
- revive
|
||||
- unconvert
|
||||
- unparam
|
||||
|
||||
@ -135,7 +135,7 @@ func opTokenWithPrefs(op *operationType, assignOpType *operationType, preference
|
||||
func extractNumberParamter(value string) (int, error) {
|
||||
parameterParser := regexp.MustCompile(`.*\(([0-9]+)\)`)
|
||||
matches := parameterParser.FindStringSubmatch(value)
|
||||
var indent, errParsingInt = strconv.ParseInt(matches[1], 10, 32) // nolint
|
||||
var indent, errParsingInt = strconv.ParseInt(matches[1], 10, 32)
|
||||
if errParsingInt != nil {
|
||||
return 0, errParsingInt
|
||||
}
|
||||
@ -198,7 +198,7 @@ func unwrap(value string) string {
|
||||
func numberValue() lex.Action {
|
||||
return func(s *lex.Scanner, m *machines.Match) (interface{}, error) {
|
||||
var numberString = string(m.Bytes)
|
||||
var number, errParsingInt = strconv.ParseInt(numberString, 10, 64) // nolint
|
||||
var number, errParsingInt = strconv.ParseInt(numberString, 10, 64)
|
||||
if errParsingInt != nil {
|
||||
return nil, errParsingInt
|
||||
}
|
||||
@ -212,7 +212,7 @@ func hexValue() lex.Action {
|
||||
var originalString = string(m.Bytes)
|
||||
var numberString = originalString[2:]
|
||||
log.Debugf("numberString: %v", numberString)
|
||||
var number, errParsingInt = strconv.ParseInt(numberString, 16, 64) // nolint
|
||||
var number, errParsingInt = strconv.ParseInt(numberString, 16, 64)
|
||||
if errParsingInt != nil {
|
||||
return nil, errParsingInt
|
||||
}
|
||||
@ -224,7 +224,7 @@ func hexValue() lex.Action {
|
||||
func floatValue() lex.Action {
|
||||
return func(s *lex.Scanner, m *machines.Match) (interface{}, error) {
|
||||
var numberString = string(m.Bytes)
|
||||
var number, errParsingInt = strconv.ParseFloat(numberString, 64) // nolint
|
||||
var number, errParsingInt = strconv.ParseFloat(numberString, 64)
|
||||
if errParsingInt != nil {
|
||||
return nil, errParsingInt
|
||||
}
|
||||
|
||||
@ -203,10 +203,10 @@ func recursiveNodeEqual(lhs *yaml.Node, rhs *yaml.Node) bool {
|
||||
func parseInt(numberString string) (string, int64, error) {
|
||||
if strings.HasPrefix(numberString, "0x") ||
|
||||
strings.HasPrefix(numberString, "0X") {
|
||||
num, err := strconv.ParseInt(numberString[2:], 16, 64) // nolint
|
||||
num, err := strconv.ParseInt(numberString[2:], 16, 64)
|
||||
return "0x%X", num, err
|
||||
}
|
||||
num, err := strconv.ParseInt(numberString, 10, 64) // nolint
|
||||
num, err := strconv.ParseInt(numberString, 10, 64)
|
||||
return "%v", num, err
|
||||
}
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ func hasOperator(d *dataTreeNavigator, context Context, expressionNode *Expressi
|
||||
case yaml.SequenceNode:
|
||||
candidateHasKey := false
|
||||
if wanted.Tag == "!!int" {
|
||||
var number, errParsingInt = strconv.ParseInt(wantedKey, 10, 64) // nolint
|
||||
var number, errParsingInt = strconv.ParseInt(wantedKey, 10, 64)
|
||||
if errParsingInt != nil {
|
||||
return Context{}, errParsingInt
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ func copyFromHeader(title string, out *os.File) error {
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
in, err := os.Open(source) // nolint gosec
|
||||
in, err := os.Open(source)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user