mirror of
https://codeberg.org/crowci/crow.git
synced 2025-08-07 20:23:03 +03:00
Enable gocritic
and don't ignore globally (#3159)
Use `nolint` directives instead. From #2960
This commit is contained in:
@@ -34,11 +34,12 @@ func ParseBytes(b []byte) (*types.Workflow, error) {
|
||||
|
||||
// support deprecated branch filter
|
||||
if out.BranchesDontUseIt != nil {
|
||||
if out.When.Constraints == nil {
|
||||
switch {
|
||||
case out.When.Constraints == nil:
|
||||
out.When.Constraints = []constraint.Constraint{{Branch: *out.BranchesDontUseIt}}
|
||||
} else if len(out.When.Constraints) == 1 && out.When.Constraints[0].Branch.IsEmpty() {
|
||||
case len(out.When.Constraints) == 1 && out.When.Constraints[0].Branch.IsEmpty():
|
||||
out.When.Constraints[0].Branch = *out.BranchesDontUseIt
|
||||
} else {
|
||||
default:
|
||||
return nil, fmt.Errorf("could not apply deprecated branches filter into global when filter")
|
||||
}
|
||||
out.BranchesDontUseIt = nil
|
||||
|
Reference in New Issue
Block a user