chore(lint): nolint should be written without leading space

This commit is contained in:
Jan De Dobbeleer 2022-08-05 08:33:02 +02:00 committed by Jan De Dobbeleer
parent 35efd3cf00
commit 5f063e80f3
27 changed files with 67 additions and 67 deletions

View file

@ -56,7 +56,7 @@ You can do the following:
}, },
} }
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
rootCmd.AddCommand(getCache) rootCmd.AddCommand(getCache)
} }

View file

@ -39,6 +39,6 @@ You can export, migrate or edit the config.`,
}, },
} }
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
rootCmd.AddCommand(configCmd) rootCmd.AddCommand(configCmd)
} }

View file

@ -73,7 +73,7 @@ func cleanOutputPath(path string, env environment.Environment) string {
return filepath.Clean(path) return filepath.Clean(path)
} }
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
exportCmd.Flags().StringVarP(&format, "format", "f", "json", "config format to migrate to") exportCmd.Flags().StringVarP(&format, "format", "f", "json", "config format to migrate to")
exportCmd.Flags().StringVarP(&output, "output", "o", "", "config file to export to") exportCmd.Flags().StringVarP(&output, "output", "o", "", "config file to export to")
configCmd.AddCommand(exportCmd) configCmd.AddCommand(exportCmd)

View file

@ -97,7 +97,7 @@ Exports the config to an image file using customized output options.`,
}, },
} }
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
imageCmd.Flags().StringVar(&author, "author", "", "config author") imageCmd.Flags().StringVar(&author, "author", "", "config author")
imageCmd.Flags().StringVar(&bgColor, "background-color", "", "image background color") imageCmd.Flags().StringVar(&bgColor, "background-color", "", "image background color")
imageCmd.Flags().IntVar(&cursorPadding, "cursor-padding", 0, "prompt cursor padding") imageCmd.Flags().IntVar(&cursorPadding, "cursor-padding", 0, "prompt cursor padding")

View file

@ -55,6 +55,6 @@ var debugCmd = &cobra.Command{
}, },
} }
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
rootCmd.AddCommand(debugCmd) rootCmd.AddCommand(debugCmd)
} }

View file

@ -43,6 +43,6 @@ This command is used to install fonts and configure the font in your terminal.
} }
) )
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
rootCmd.AddCommand(fontCmd) rootCmd.AddCommand(fontCmd)
} }

View file

@ -56,6 +56,6 @@ This command is used to get the value of the following variables:
}, },
} }
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
rootCmd.AddCommand(getCmd) rootCmd.AddCommand(getCmd)
} }

View file

@ -39,7 +39,7 @@ See the documentation to initialize your shell: https://ohmyposh.dev/docs/instal
} }
) )
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
initCmd.Flags().BoolVarP(&print, "print", "p", false, "print the init script") initCmd.Flags().BoolVarP(&print, "print", "p", false, "print the init script")
initCmd.Flags().BoolVarP(&strict, "strict", "s", false, "run in strict mode") initCmd.Flags().BoolVarP(&strict, "strict", "s", false, "run in strict mode")
_ = initCmd.MarkPersistentFlagRequired("config") _ = initCmd.MarkPersistentFlagRequired("config")

View file

@ -116,7 +116,7 @@ var printCmd = &cobra.Command{
}, },
} }
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
printCmd.Flags().StringVar(&pwd, "pwd", "", "current working directory") printCmd.Flags().StringVar(&pwd, "pwd", "", "current working directory")
printCmd.Flags().StringVar(&pswd, "pswd", "", "current working directory (according to pwsh)") printCmd.Flags().StringVar(&pswd, "pswd", "", "current working directory (according to pwsh)")
printCmd.Flags().StringVar(&shellName, "shell", "", "the shell to print for") printCmd.Flags().StringVar(&shellName, "shell", "", "the shell to print for")

View file

@ -15,7 +15,7 @@ var promptCmd = &cobra.Command{
}, },
} }
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
// legacy support // legacy support
promptCmd.AddCommand(initCmd) promptCmd.AddCommand(initCmd)
promptCmd.AddCommand(debugCmd) promptCmd.AddCommand(debugCmd)

View file

@ -48,7 +48,7 @@ var (
initialize bool initialize bool
) )
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
rootCmd.PersistentFlags().StringVarP(&config, "config", "c", "", "config (required)") rootCmd.PersistentFlags().StringVarP(&config, "config", "c", "", "config (required)")
rootCmd.Flags().BoolVarP(&initialize, "init", "i", false, "init (deprecated)") rootCmd.Flags().BoolVarP(&initialize, "init", "i", false, "init (deprecated)")
rootCmd.Flags().BoolVar(&displayVersion, "version", false, "version") rootCmd.Flags().BoolVar(&displayVersion, "version", false, "version")

View file

@ -17,6 +17,6 @@ var versionCmd = &cobra.Command{
}, },
} }
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
rootCmd.AddCommand(versionCmd) rootCmd.AddCommand(versionCmd)
} }

View file

@ -7,7 +7,7 @@ import (
"github.com/mattn/go-runewidth" "github.com/mattn/go-runewidth"
) )
func init() { // nolint:gochecknoinits func init() { //nolint:gochecknoinits
runewidth.DefaultCondition.EastAsianWidth = false runewidth.DefaultCondition.EastAsianWidth = false
} }

View file

@ -376,7 +376,7 @@ func (e *Engine) PrintExtraPrompt(promptType ExtraPromptType) string {
if len(template) != 0 { if len(template) != 0 {
return template return template
} }
switch promptType { // nolint: exhaustive switch promptType { //nolint: exhaustive
case Debug: case Debug:
return "[DBG]: " return "[DBG]: "
case Transient: case Transient:

View file

@ -48,7 +48,7 @@ func (segment *Segment) migrationOne(env environment.Environment) {
// General properties that need replacement // General properties that need replacement
segment.migratePropertyKey("display_version", properties.FetchVersion) segment.migratePropertyKey("display_version", properties.FetchVersion)
delete(segment.Properties, "enable_hyperlink") delete(segment.Properties, "enable_hyperlink")
switch segment.Type { // nolint:exhaustive switch segment.Type { //nolint:exhaustive
case TEXT: case TEXT:
segment.migratePropertyKey("text", segmentTemplate) segment.migratePropertyKey("text", segmentTemplate)
segment.migrateTemplate() segment.migrateTemplate()

View file

@ -195,7 +195,7 @@ func TestSegmentTemplateMigration(t *testing.T) {
}{ }{
{ {
Case: "GIT", Case: "GIT",
Expected: " {{ .HEAD }} {{ .BranchStatus }}{{ if .Working.Changed }} working {{ .Working.String }}{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} and{{ end }}{{ if .Staging.Changed }} staged {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0}} stash {{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}} worktree {{ .WorktreeCount }}{{ end }} ", // nolint: lll Expected: " {{ .HEAD }} {{ .BranchStatus }}{{ if .Working.Changed }} working {{ .Working.String }}{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} and{{ end }}{{ if .Staging.Changed }} staged {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0}} stash {{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}} worktree {{ .WorktreeCount }}{{ end }} ", //nolint: lll
Type: GIT, Type: GIT,
Props: properties.Map{ Props: properties.Map{
"local_working_icon": " working ", "local_working_icon": " working ",
@ -207,7 +207,7 @@ func TestSegmentTemplateMigration(t *testing.T) {
}, },
{ {
Case: "GIT - Staging and Working Color", Case: "GIT - Staging and Working Color",
Expected: " {{ .HEAD }} {{ .BranchStatus }}{{ if .Working.Changed }} working <#123456>{{ .Working.String }}</>{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} and{{ end }}{{ if .Staging.Changed }} staged <#123456>{{ .Staging.String }}</>{{ end }}{{ if gt .StashCount 0}} stash {{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}} worktree {{ .WorktreeCount }}{{ end }} ", // nolint: lll Expected: " {{ .HEAD }} {{ .BranchStatus }}{{ if .Working.Changed }} working <#123456>{{ .Working.String }}</>{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} and{{ end }}{{ if .Staging.Changed }} staged <#123456>{{ .Staging.String }}</>{{ end }}{{ if gt .StashCount 0}} stash {{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}} worktree {{ .WorktreeCount }}{{ end }} ", //nolint: lll
Type: GIT, Type: GIT,
Props: properties.Map{ Props: properties.Map{
"local_working_icon": " working ", "local_working_icon": " working ",

View file

@ -72,7 +72,7 @@ type guid struct {
type spDeviceInterfaceData struct { type spDeviceInterfaceData struct {
cbSize uint32 cbSize uint32
InterfaceClassGuid guid // nolint:revive InterfaceClassGuid guid //nolint:revive
Flags uint32 Flags uint32
Reserved uint Reserved uint
} }
@ -92,7 +92,7 @@ func uint32ToFloat64(num uint32) (float64, error) {
} }
func setupDiSetup(proc *windows.LazyProc, nargs, a1, a2, a3, a4, a5, a6 uintptr) (uintptr, error) { func setupDiSetup(proc *windows.LazyProc, nargs, a1, a2, a3, a4, a5, a6 uintptr) (uintptr, error) {
r1, _, errno := syscall.Syscall6(proc.Addr(), nargs, a1, a2, a3, a4, a5, a6) // nolint:staticcheck r1, _, errno := syscall.Syscall6(proc.Addr(), nargs, a1, a2, a3, a4, a5, a6) //nolint:staticcheck
if windows.Handle(r1) == windows.InvalidHandle { if windows.Handle(r1) == windows.InvalidHandle {
if errno != 0 { if errno != 0 {
return 0, error(errno) return 0, error(errno)
@ -103,7 +103,7 @@ func setupDiSetup(proc *windows.LazyProc, nargs, a1, a2, a3, a4, a5, a6 uintptr)
} }
func setupDiCall(proc *windows.LazyProc, nargs, a1, a2, a3, a4, a5, a6 uintptr) syscall.Errno { func setupDiCall(proc *windows.LazyProc, nargs, a1, a2, a3, a4, a5, a6 uintptr) syscall.Errno {
r1, _, errno := syscall.Syscall6(proc.Addr(), nargs, a1, a2, a3, a4, a5, a6) // nolint:staticcheck r1, _, errno := syscall.Syscall6(proc.Addr(), nargs, a1, a2, a3, a4, a5, a6) //nolint:staticcheck
if r1 == 0 { if r1 == 0 {
if errno != 0 { if errno != 0 {
return errno return errno
@ -148,7 +148,7 @@ func systemGet(idx int) (*battery, error) {
return nil, err return nil, err
} }
defer func() { defer func() {
_, _, _ = syscall.Syscall(setupDiDestroyDeviceInfoList.Addr(), 1, hdev, 0, 0) // nolint:staticcheck _, _, _ = syscall.Syscall(setupDiDestroyDeviceInfoList.Addr(), 1, hdev, 0, 0) //nolint:staticcheck
}() }()
var did spDeviceInterfaceData var did spDeviceInterfaceData

View file

@ -434,45 +434,45 @@ func (env *ShellEnvironment) parseNetworkInterface(network *WLAN_INTERFACE_INFO,
return &info, nil return &info, nil
} }
type WLAN_INTERFACE_INFO_LIST struct { // nolint: revive type WLAN_INTERFACE_INFO_LIST struct { //nolint: revive
dwNumberOfItems uint32 dwNumberOfItems uint32
dwIndex uint32 // nolint: unused dwIndex uint32 //nolint: unused
InterfaceInfo [1]WLAN_INTERFACE_INFO InterfaceInfo [1]WLAN_INTERFACE_INFO
} }
type WLAN_INTERFACE_INFO struct { // nolint: revive type WLAN_INTERFACE_INFO struct { //nolint: revive
InterfaceGuid syscall.GUID // nolint: revive InterfaceGuid syscall.GUID //nolint: revive
strInterfaceDescription [256]uint16 strInterfaceDescription [256]uint16
isState uint32 isState uint32
} }
type WLAN_CONNECTION_ATTRIBUTES struct { // nolint: revive type WLAN_CONNECTION_ATTRIBUTES struct { //nolint: revive
isState uint32 // nolint: unused isState uint32 //nolint: unused
wlanConnectionMode uint32 // nolint: unused wlanConnectionMode uint32 //nolint: unused
strProfileName [256]uint16 // nolint: unused strProfileName [256]uint16 //nolint: unused
wlanAssociationAttributes WLAN_ASSOCIATION_ATTRIBUTES wlanAssociationAttributes WLAN_ASSOCIATION_ATTRIBUTES
wlanSecurityAttributes WLAN_SECURITY_ATTRIBUTES wlanSecurityAttributes WLAN_SECURITY_ATTRIBUTES
} }
type WLAN_ASSOCIATION_ATTRIBUTES struct { // nolint: revive type WLAN_ASSOCIATION_ATTRIBUTES struct { //nolint: revive
dot11Ssid DOT11_SSID dot11Ssid DOT11_SSID
dot11BssType uint32 dot11BssType uint32
dot11Bssid [6]uint8 // nolint: unused dot11Bssid [6]uint8 //nolint: unused
dot11PhyType uint32 dot11PhyType uint32
uDot11PhyIndex uint32 // nolint: unused uDot11PhyIndex uint32 //nolint: unused
wlanSignalQuality uint32 wlanSignalQuality uint32
ulRxRate uint32 ulRxRate uint32
ulTxRate uint32 ulTxRate uint32
} }
type WLAN_SECURITY_ATTRIBUTES struct { // nolint: revive type WLAN_SECURITY_ATTRIBUTES struct { //nolint: revive
bSecurityEnabled uint32 bSecurityEnabled uint32
bOneXEnabled uint32 // nolint: unused bOneXEnabled uint32 //nolint: unused
dot11AuthAlgorithm uint32 dot11AuthAlgorithm uint32
dot11CipherAlgorithm uint32 dot11CipherAlgorithm uint32
} }
type DOT11_SSID struct { // nolint: revive type DOT11_SSID struct { //nolint: revive
uSSIDLength uint32 uSSIDLength uint32
ucSSID [32]uint8 ucSSID [32]uint8
} }

View file

@ -112,7 +112,7 @@ func queryWindowTitles(processName, windowTitleRegex string) (string, error) {
return title, nil return title, nil
} }
type REPARSE_DATA_BUFFER struct { // nolint: revive type REPARSE_DATA_BUFFER struct { //nolint: revive
ReparseTag uint32 ReparseTag uint32
ReparseDataLength uint16 ReparseDataLength uint16
Reserved uint16 Reserved uint16
@ -176,7 +176,7 @@ func readWinAppLink(path string) (string, error) {
if err != nil { if err != nil {
return "", err return "", err
} }
defer syscall.CloseHandle(h) // nolint: errcheck defer syscall.CloseHandle(h) //nolint: errcheck
rdbbuf := make([]byte, syscall.MAXIMUM_REPARSE_DATA_BUFFER_SIZE) rdbbuf := make([]byte, syscall.MAXIMUM_REPARSE_DATA_BUFFER_SIZE)
var bytesReturned uint32 var bytesReturned uint32

View file

@ -15,8 +15,8 @@ import (
var FontsDir = filepath.Join(os.Getenv("WINDIR"), "Fonts") var FontsDir = filepath.Join(os.Getenv("WINDIR"), "Fonts")
const ( const (
WM_FONTCHANGE = 0x001D // nolint:revive WM_FONTCHANGE = 0x001D //nolint:revive
HWND_BROADCAST = 0xFFFF // nolint:revive HWND_BROADCAST = 0xFFFF //nolint:revive
) )
func install(font *Font) (err error) { func install(font *Font) (err error) {

View file

@ -97,7 +97,7 @@ type Batch struct {
} }
func (bf *Brewfather) Template() string { func (bf *Brewfather) Template() string {
return " {{ .StatusIcon }} {{ if .DaysBottledOrFermented }}{{ .DaysBottledOrFermented }}{{ .DayIcon }} {{ end }}{{ url .Recipe.Name .URL }} {{ printf \"%.1f\" .MeasuredAbv }}%{{ if and (.Reading) (eq .Status \"Fermenting\") }} {{ printf \"%.3f\" .Reading.Gravity }} {{ .Reading.Temperature }}\u00b0 {{ .TemperatureTrendIcon }}{{ end }} " // nolint:lll return " {{ .StatusIcon }} {{ if .DaysBottledOrFermented }}{{ .DaysBottledOrFermented }}{{ .DayIcon }} {{ end }}{{ url .Recipe.Name .URL }} {{ printf \"%.1f\" .MeasuredAbv }}%{{ if and (.Reading) (eq .Status \"Fermenting\") }} {{ printf \"%.3f\" .Reading.Gravity }} {{ .Reading.Temperature }}\u00b0 {{ .TemperatureTrendIcon }}{{ end }} " //nolint:lll
} }
func (bf *Brewfather) Enabled() bool { func (bf *Brewfather) Enabled() bool {

View file

@ -49,7 +49,7 @@ func TestBrewfatherSegment(t *testing.T) {
{ {
Case: "Planning Status", Case: "Planning Status",
BatchJSONResponse: ` BatchJSONResponse: `
{"batchNo":18,"status":"Planning","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, // nolint:lll {"batchNo":18,"status":"Planning","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, //nolint:lll
BatchReadingsJSONResponse: `[]`, BatchReadingsJSONResponse: `[]`,
Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll
ExpectedString: " Fake Beer 1.3%", ExpectedString: " Fake Beer 1.3%",
@ -58,7 +58,7 @@ func TestBrewfatherSegment(t *testing.T) {
{ {
Case: "Brewing Status", Case: "Brewing Status",
BatchJSONResponse: ` BatchJSONResponse: `
{"batchNo":18,"status":"Brewing","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, // nolint:lll {"batchNo":18,"status":"Brewing","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, //nolint:lll
BatchReadingsJSONResponse: `[]`, BatchReadingsJSONResponse: `[]`,
Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll
ExpectedString: " Fake Beer 1.3%", ExpectedString: " Fake Beer 1.3%",
@ -67,7 +67,7 @@ func TestBrewfatherSegment(t *testing.T) {
{ {
Case: "Fermenting Status, no readings", Case: "Fermenting Status, no readings",
BatchJSONResponse: ` BatchJSONResponse: `
{"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, // nolint:lll {"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, //nolint:lll
BatchReadingsJSONResponse: `[]`, BatchReadingsJSONResponse: `[]`,
Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll
ExpectedString: " 19d Fake Beer 1.3%", ExpectedString: " 19d Fake Beer 1.3%",
@ -76,7 +76,7 @@ func TestBrewfatherSegment(t *testing.T) {
{ {
Case: "Fermenting Status, one reading", Case: "Fermenting Status, one reading",
BatchJSONResponse: ` BatchJSONResponse: `
{"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, // nolint:lll {"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, //nolint:lll
BatchReadingsJSONResponse: `[{"id":"manual","temp":19.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}]`, BatchReadingsJSONResponse: `[{"id":"manual","temp":19.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}]`,
Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll
ExpectedString: " 19d Fake Beer 1.3%: 1.066 19.5° →", ExpectedString: " 19d Fake Beer 1.3%: 1.066 19.5° →",
@ -85,8 +85,8 @@ func TestBrewfatherSegment(t *testing.T) {
{ {
Case: "Fermenting Status, two readings, temp trending up", Case: "Fermenting Status, two readings, temp trending up",
BatchJSONResponse: ` BatchJSONResponse: `
{"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, // nolint:lll {"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, //nolint:lll
BatchReadingsJSONResponse: `[{"id":"manual","temp":19.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}, {"id":"manual","temp":21,"comment":"","sg":1.063,"time":` + FakeReading2DateString + `,"type":"manual"}]`, // nolint:lll BatchReadingsJSONResponse: `[{"id":"manual","temp":19.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}, {"id":"manual","temp":21,"comment":"","sg":1.063,"time":` + FakeReading2DateString + `,"type":"manual"}]`, //nolint:lll
Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll
ExpectedString: " 19d Fake Beer 1.3%: 1.063 21° ↗", ExpectedString: " 19d Fake Beer 1.3%: 1.063 21° ↗",
ExpectedEnabled: true, ExpectedEnabled: true,
@ -94,8 +94,8 @@ func TestBrewfatherSegment(t *testing.T) {
{ {
Case: "Fermenting Status, three readings, temp trending hard down, include age of most recent reading", Case: "Fermenting Status, three readings, temp trending hard down, include age of most recent reading",
BatchJSONResponse: ` BatchJSONResponse: `
{"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, // nolint:lll {"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, //nolint:lll
BatchReadingsJSONResponse: `[{"id":"manual","temp":19.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}, {"id":"manual","temp":21,"comment":"","sg":1.063,"time":` + FakeReading2DateString + `,"type":"manual"}, {"id":"manual","temp":15,"comment":"","sg":1.050,"time":` + FakeReading3DateString + `,"type":"manual"}]`, // nolint:lll BatchReadingsJSONResponse: `[{"id":"manual","temp":19.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}, {"id":"manual","temp":21,"comment":"","sg":1.063,"time":` + FakeReading2DateString + `,"type":"manual"}, {"id":"manual","temp":15,"comment":"","sg":1.050,"time":` + FakeReading3DateString + `,"type":"manual"}]`, //nolint:lll
Template: "{{.StatusIcon}} {{.ReadingAge}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll Template: "{{.StatusIcon}} {{.ReadingAge}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll
ExpectedString: " 451 19d Fake Beer 1.3%: 1.05 15° ↓↓", ExpectedString: " 451 19d Fake Beer 1.3%: 1.05 15° ↓↓",
ExpectedEnabled: true, ExpectedEnabled: true,
@ -103,7 +103,7 @@ func TestBrewfatherSegment(t *testing.T) {
{ {
Case: "Bad batch json, readings fine", Case: "Bad batch json, readings fine",
BatchJSONResponse: ``, BatchJSONResponse: ``,
BatchReadingsJSONResponse: `[{"id":"manual","temp":19.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}, {"id":"manual","temp":21,"comment":"","sg":1.063,"time":` + FakeReading2DateString + `,"type":"manual"}, {"id":"manual","temp":15,"comment":"","sg":1.050,"time":` + FakeReading3DateString + `,"type":"manual"}]`, // nolint:lll BatchReadingsJSONResponse: `[{"id":"manual","temp":19.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}, {"id":"manual","temp":21,"comment":"","sg":1.063,"time":` + FakeReading2DateString + `,"type":"manual"}, {"id":"manual","temp":15,"comment":"","sg":1.050,"time":` + FakeReading3DateString + `,"type":"manual"}]`, //nolint:lll
Template: "{{.StatusIcon}} {{.ReadingAge}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll Template: "{{.StatusIcon}} {{.ReadingAge}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll
ExpectedString: "", ExpectedString: "",
ExpectedEnabled: false, ExpectedEnabled: false,
@ -111,8 +111,8 @@ func TestBrewfatherSegment(t *testing.T) {
{ {
Case: "Conditioning Status", Case: "Conditioning Status",
BatchJSONResponse: ` BatchJSONResponse: `
{"batchNo":18,"status":"Conditioning","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, // nolint:lll {"batchNo":18,"status":"Conditioning","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, //nolint:lll
BatchReadingsJSONResponse: `[{"id":"manual","temp":19.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}, {"id":"manual","temp":21,"comment":"","sg":1.063,"time":` + FakeReading2DateString + `,"type":"manual"}, {"id":"manual","temp":15,"comment":"","sg":1.050,"time":` + FakeReading3DateString + `,"type":"manual"}]`, // nolint:lll BatchReadingsJSONResponse: `[{"id":"manual","temp":19.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}, {"id":"manual","temp":21,"comment":"","sg":1.063,"time":` + FakeReading2DateString + `,"type":"manual"}, {"id":"manual","temp":15,"comment":"","sg":1.050,"time":` + FakeReading3DateString + `,"type":"manual"}]`, //nolint:lll
Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll Template: "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d {{end}}{{.Recipe.Name}} {{.MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{.Reading.Gravity}} {{.Reading.Temperature}}° {{.TemperatureTrendIcon}}{{end}}", //nolint:lll
ExpectedString: " 5d Fake Beer 1.3%", ExpectedString: " 5d Fake Beer 1.3%",
ExpectedEnabled: true, ExpectedEnabled: true,
@ -120,7 +120,7 @@ func TestBrewfatherSegment(t *testing.T) {
{ {
Case: "Fermenting Status, test all unit conversions", Case: "Fermenting Status, test all unit conversions",
BatchJSONResponse: ` BatchJSONResponse: `
{"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, // nolint:lll {"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, //nolint:lll
BatchReadingsJSONResponse: `[{"id":"manual","temp":34.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}]`, BatchReadingsJSONResponse: `[{"id":"manual","temp":34.5,"comment":"","sg":1.066,"time":` + FakeReading1DateString + `,"type":"manual"}]`,
Template: "{{ if and (.Reading) (eq .Status \"Fermenting\") }}SG: ({{.Reading.Gravity}} Bx:{{.SGToBrix .Reading.Gravity}} P:{{.SGToPlato .Reading.Gravity}}), Temp: (C:{{.Reading.Temperature}} F:{{.DegCToF .Reading.Temperature}} K:{{.DegCToKelvin .Reading.Temperature}}){{end}}", //nolint:lll Template: "{{ if and (.Reading) (eq .Status \"Fermenting\") }}SG: ({{.Reading.Gravity}} Bx:{{.SGToBrix .Reading.Gravity}} P:{{.SGToPlato .Reading.Gravity}}), Temp: (C:{{.Reading.Temperature}} F:{{.DegCToF .Reading.Temperature}} K:{{.DegCToKelvin .Reading.Temperature}}){{end}}", //nolint:lll
ExpectedString: "SG: (1.066 Bx:16.13 P:16.13), Temp: (C:34.5 F:94.1 K:307.7)", ExpectedString: "SG: (1.066 Bx:16.13 P:16.13), Temp: (C:34.5 F:94.1 K:307.7)",
@ -129,7 +129,7 @@ func TestBrewfatherSegment(t *testing.T) {
{ {
Case: "Fermenting Status, test all unit conversions 2", Case: "Fermenting Status, test all unit conversions 2",
BatchJSONResponse: ` BatchJSONResponse: `
{"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, // nolint:lll {"batchNo":18,"status":"Fermenting","brewDate":` + FakeBrewDateString + `,"bottlingDate":` + FakeBottlingDateString + `,"recipe":{"name":"Fake Beer"},"fermentationStartDate":` + FakeFermStartDateString + `,"name":"Batch","measuredAbv": 1.3}`, //nolint:lll
BatchReadingsJSONResponse: `[{"id":"manual","temp":3.5,"comment":"","sg":1.004,"time":` + FakeReading1DateString + `,"type":"manual"}]`, BatchReadingsJSONResponse: `[{"id":"manual","temp":3.5,"comment":"","sg":1.004,"time":` + FakeReading1DateString + `,"type":"manual"}]`,
Template: "{{ if and (.Reading) (eq .Status \"Fermenting\") }}SG: ({{.Reading.Gravity}} Bx:{{.SGToBrix .Reading.Gravity}} P:{{.SGToPlato .Reading.Gravity}}), Temp: (C:{{.Reading.Temperature}} F:{{.DegCToF .Reading.Temperature}} K:{{.DegCToKelvin .Reading.Temperature}}){{end}}", //nolint:lll Template: "{{ if and (.Reading) (eq .Status \"Fermenting\") }}SG: ({{.Reading.Gravity}} Bx:{{.SGToBrix .Reading.Gravity}} P:{{.SGToPlato .Reading.Gravity}}), Temp: (C:{{.Reading.Temperature}} F:{{.DegCToF .Reading.Temperature}} K:{{.DegCToKelvin .Reading.Temperature}}){{end}}", //nolint:lll
ExpectedString: "SG: (1.004 Bx:1.03 P:1.03), Temp: (C:3.5 F:38.3 K:276.7)", ExpectedString: "SG: (1.004 Bx:1.03 P:1.03), Temp: (C:3.5 F:38.3 K:276.7)",

View file

@ -29,7 +29,7 @@ func (d *Dotnet) Init(props properties.Properties, env environment.Environment)
`(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?))`, `(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?))`,
}, },
}, },
versionURLTemplate: "https://github.com/dotnet/core/blob/master/release-notes/{{ .Major }}.{{ .Minor }}/{{ .Major }}.{{ .Minor }}.{{ substr 0 1 .Patch }}/{{ .Major }}.{{ .Minor }}.{{ substr 0 1 .Patch }}.md", // nolint: lll versionURLTemplate: "https://github.com/dotnet/core/blob/master/release-notes/{{ .Major }}.{{ .Minor }}/{{ .Major }}.{{ .Minor }}.{{ substr 0 1 .Patch }}/{{ .Major }}.{{ .Minor }}.{{ substr 0 1 .Patch }}.md", //nolint: lll
} }
} }

View file

@ -110,7 +110,7 @@ const (
) )
func (g *Git) Template() string { func (g *Git) Template() string {
return " {{ .HEAD }} {{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0}} \uF692 {{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}} \uf1bb {{ .WorktreeCount }}{{ end }} " // nolint: lll return " {{ .HEAD }} {{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0}} \uF692 {{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}} \uf1bb {{ .WorktreeCount }}{{ end }} " //nolint: lll
} }
func (g *Git) Enabled() bool { func (g *Git) Enabled() bool {

View file

@ -20,7 +20,7 @@ func TestJava(t *testing.T) {
{ {
Case: "Zulu LTS", Case: "Zulu LTS",
ExpectedString: "11.0.13", ExpectedString: "11.0.13",
Version: "OpenJDK 64-Bit Server VM (11.0.13+8-LTS) for windows-amd64 JRE (Zulu11.52+13-CA) (11.0.13+8-LTS), built on Oct 7 2021 16:00:23 by \"zulu_re\" with MS VC++ 15.9 (VS2017)", // nolint:lll Version: "OpenJDK 64-Bit Server VM (11.0.13+8-LTS) for windows-amd64 JRE (Zulu11.52+13-CA) (11.0.13+8-LTS), built on Oct 7 2021 16:00:23 by \"zulu_re\" with MS VC++ 15.9 (VS2017)", //nolint:lll
}, },
{ {
Case: "OpenJDK macOS", Case: "OpenJDK macOS",

View file

@ -28,7 +28,7 @@ func TestNSSegment(t *testing.T) {
{ {
Case: "Flat 150", Case: "Flat 150",
JSONResponse: ` JSONResponse: `
[{"_id":"619d6fa819696e8ded5b2206","sgv":150,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"Flat","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, // nolint:lll [{"_id":"619d6fa819696e8ded5b2206","sgv":150,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"Flat","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, //nolint:lll
Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}", Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}",
ExpectedString: "\ue2a1 150→", ExpectedString: "\ue2a1 150→",
ExpectedEnabled: true, ExpectedEnabled: true,
@ -36,7 +36,7 @@ func TestNSSegment(t *testing.T) {
{ {
Case: "DoubleDown 50", Case: "DoubleDown 50",
JSONResponse: ` JSONResponse: `
[{"_id":"619d6fa819696e8ded5b2206","sgv":50,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"DoubleDown","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, // nolint:lll [{"_id":"619d6fa819696e8ded5b2206","sgv":50,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"DoubleDown","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, //nolint:lll
Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}", Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}",
ExpectedString: "\ue2a1 50↓↓", ExpectedString: "\ue2a1 50↓↓",
ExpectedEnabled: true, ExpectedEnabled: true,
@ -44,7 +44,7 @@ func TestNSSegment(t *testing.T) {
{ {
Case: "DoubleUp 250", Case: "DoubleUp 250",
JSONResponse: ` JSONResponse: `
[{"_id":"619d6fa819696e8ded5b2206","sgv":250,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"DoubleUp","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, // nolint:lll [{"_id":"619d6fa819696e8ded5b2206","sgv":250,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"DoubleUp","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, //nolint:lll
Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}", Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}",
ExpectedString: "\ue2a1 250↑↑", ExpectedString: "\ue2a1 250↑↑",
ExpectedEnabled: true, ExpectedEnabled: true,
@ -52,7 +52,7 @@ func TestNSSegment(t *testing.T) {
{ {
Case: "SingleUp 130", Case: "SingleUp 130",
JSONResponse: ` JSONResponse: `
[{"_id":"619d6fa819696e8ded5b2206","sgv":130,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"SingleUp","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, // nolint:lll [{"_id":"619d6fa819696e8ded5b2206","sgv":130,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"SingleUp","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, //nolint:lll
Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}", Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}",
ExpectedString: "\ue2a1 130↑", ExpectedString: "\ue2a1 130↑",
ExpectedEnabled: true, ExpectedEnabled: true,
@ -60,7 +60,7 @@ func TestNSSegment(t *testing.T) {
{ {
Case: "FortyFiveUp 174", Case: "FortyFiveUp 174",
JSONResponse: ` JSONResponse: `
[{"_id":"619d6fa819696e8ded5b2206","sgv":174,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"FortyFiveUp","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, // nolint:lll [{"_id":"619d6fa819696e8ded5b2206","sgv":174,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"FortyFiveUp","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, //nolint:lll
Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}", Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}",
ExpectedString: "\ue2a1 174↗", ExpectedString: "\ue2a1 174↗",
ExpectedEnabled: true, ExpectedEnabled: true,
@ -68,7 +68,7 @@ func TestNSSegment(t *testing.T) {
{ {
Case: "FortyFiveDown 61", Case: "FortyFiveDown 61",
JSONResponse: ` JSONResponse: `
[{"_id":"619d6fa819696e8ded5b2206","sgv":61,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"FortyFiveDown","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, // nolint:lll [{"_id":"619d6fa819696e8ded5b2206","sgv":61,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"FortyFiveDown","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, //nolint:lll
Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}", Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}",
ExpectedString: "\ue2a1 61↘", ExpectedString: "\ue2a1 61↘",
ExpectedEnabled: true, ExpectedEnabled: true,
@ -76,7 +76,7 @@ func TestNSSegment(t *testing.T) {
{ {
Case: "DoubleDown 50", Case: "DoubleDown 50",
JSONResponse: ` JSONResponse: `
[{"_id":"619d6fa819696e8ded5b2206","sgv":50,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"DoubleDown","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, // nolint:lll [{"_id":"619d6fa819696e8ded5b2206","sgv":50,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"DoubleDown","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, //nolint:lll
Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}", Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}",
ExpectedString: "\ue2a1 50↓↓", ExpectedString: "\ue2a1 50↓↓",
ExpectedEnabled: true, ExpectedEnabled: true,
@ -95,7 +95,7 @@ func TestNSSegment(t *testing.T) {
{ {
Case: "DoubleDown 50 from cache", Case: "DoubleDown 50 from cache",
JSONResponse: ` JSONResponse: `
[{"_id":"619d6fa819696e8ded5b2206","sgv":50,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"DoubleDown","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, // nolint:lll [{"_id":"619d6fa819696e8ded5b2206","sgv":50,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"DoubleDown","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, //nolint:lll
Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}", Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}",
ExpectedString: "\ue2a1 50↓↓", ExpectedString: "\ue2a1 50↓↓",
ExpectedEnabled: true, ExpectedEnabled: true,
@ -104,7 +104,7 @@ func TestNSSegment(t *testing.T) {
{ {
Case: "DoubleDown 50 from cache not found", Case: "DoubleDown 50 from cache not found",
JSONResponse: ` JSONResponse: `
[{"_id":"619d6fa819696e8ded5b2206","sgv":50,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"DoubleDown","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, // nolint:lll [{"_id":"619d6fa819696e8ded5b2206","sgv":50,"date":1637707537000,"dateString":"2021-11-23T22:45:37.000Z","trend":4,"direction":"DoubleDown","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2021-11-23T22:45:37.000Z","mills":1637707537000}]`, //nolint:lll
Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}", Template: "\ue2a1 {{.Sgv}}{{.TrendIcon}}",
ExpectedString: "\ue2a1 50↓↓", ExpectedString: "\ue2a1 50↓↓",
ExpectedEnabled: true, ExpectedEnabled: true,

View file

@ -557,7 +557,7 @@ func TestGetFolderPathCustomMappedLocations(t *testing.T) {
assert.Equal(t, "#", got) assert.Equal(t, "#", got)
} }
func TestAgnosterPath(t *testing.T) { // nolint:dupl func TestAgnosterPath(t *testing.T) { //nolint:dupl
cases := []struct { cases := []struct {
Case string Case string
Expected string Expected string
@ -605,7 +605,7 @@ func TestAgnosterPath(t *testing.T) { // nolint:dupl
} }
} }
func TestAgnosterLeftPath(t *testing.T) { // nolint:dupl func TestAgnosterLeftPath(t *testing.T) { //nolint:dupl
cases := []struct { cases := []struct {
Case string Case string
Expected string Expected string