mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
chore(lint): golangci-lint 1.57.0 compatibility
This commit is contained in:
parent
17deda093d
commit
ab5a9ed3a7
|
@ -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
|
||||
|
|
|
@ -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()))
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue