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:
enabled-tags:
- diagnostic
- experimental
# - experimental
- opinionated
- performance
- style
disabled-tags:
- experimental
disabled-checks:
- ifElseChain
lll:
line-length: 180

View file

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

View file

@ -86,7 +86,7 @@ func TestOWMSegmentSingle(t *testing.T) {
for _, tc := range cases {
env := &mock.MockedEnvironment{}
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{
APIKey: "key",
Location: tc.Location,

View file

@ -105,7 +105,7 @@ func mockFilePresence(tc *testCase, ui5tooling *UI5Tooling, env *mock.MockedEnvi
}
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("HasFileInParentDirs", f, uint(4)).Return(false)
// mode context, working dir != working dir root

View file

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