chore(lint): golangci-lint 1.57.0 compatibility

This commit is contained in:
Jan De Dobbeleer 2024-03-23 20:16:21 +01:00 committed by github-actions[bot]
parent 17deda093d
commit ab5a9ed3a7
5 changed files with 5 additions and 7 deletions

View file

@ -36,13 +36,11 @@ linters-settings:
gocritic: gocritic:
enabled-tags: enabled-tags:
- diagnostic - diagnostic
- experimental # - experimental
- opinionated - opinionated
- performance - performance
- style - style
disabled-tags: disabled-tags:
- experimental - experimental
disabled-checks:
- ifElseChain
lll: lll:
line-length: 180 line-length: 180

View file

@ -428,7 +428,7 @@ func (w *Writer) writeSegmentColors() {
return return
} }
if fg.IsTransparent() && len(w.TerminalBackground) != 0 { if fg.IsTransparent() && len(w.TerminalBackground) != 0 { //nolint: gocritic
background := w.getAnsiFromColorString(w.TerminalBackground, false) background := w.getAnsiFromColorString(w.TerminalBackground, false)
w.writeEscapedAnsiString(fmt.Sprintf(colorise, background)) w.writeEscapedAnsiString(fmt.Sprintf(colorise, background))
w.writeEscapedAnsiString(fmt.Sprintf(colorise, bg.ToForeground())) w.writeEscapedAnsiString(fmt.Sprintf(colorise, bg.ToForeground()))

View file

@ -86,7 +86,7 @@ func TestOWMSegmentSingle(t *testing.T) {
for _, tc := range cases { for _, tc := range cases {
env := &mock.MockedEnvironment{} env := &mock.MockedEnvironment{}
var props properties.Map var props properties.Map
if tc.Latitude != 0 && tc.Longitude != 0 && tc.Location != "" { if tc.Latitude != 0 && tc.Longitude != 0 && tc.Location != "" { //nolint: gocritic
props = properties.Map{ props = properties.Map{
APIKey: "key", APIKey: "key",
Location: tc.Location, Location: tc.Location,

View file

@ -105,7 +105,7 @@ func mockFilePresence(tc *testCase, ui5tooling *UI5Tooling, env *mock.MockedEnvi
} }
if match { if match {
if tc.DisplayMode == DisplayModeFiles && tc.WorkingDir == WorkingDirRoot { if tc.DisplayMode == DisplayModeFiles && tc.WorkingDir == WorkingDirRoot { //nolint: gocritic
env.On("HasFiles", f).Return(true) env.On("HasFiles", f).Return(true)
env.On("HasFileInParentDirs", f, uint(4)).Return(false) env.On("HasFileInParentDirs", f, uint(4)).Return(false)
// mode context, working dir != working dir root // mode context, working dir != working dir root

View file

@ -158,7 +158,7 @@ func (t *Text) cleanTemplate() {
continue continue
} }
// end of a variable, needs to be appended // end of a variable, needs to be appended
if !isKnownVariable(property) { if !isKnownVariable(property) { //nolint: gocritic
result += ".Data" + property result += ".Data" + property
} else if strings.HasPrefix(property, ".Segments") && !strings.HasSuffix(property, ".Contains") { } else if strings.HasPrefix(property, ".Segments") && !strings.HasSuffix(property, ".Contains") {
// as we can't provide a clean way to access the list // as we can't provide a clean way to access the list