Skip to content

Commit 7cc2df9

Browse files
committed
chore: fix linter
1 parent 3d1c197 commit 7cc2df9

33 files changed

+401
-352
lines changed

bin/memos/main.go

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,17 @@ import (
1212
"github.com/spf13/cobra"
1313
"github.com/spf13/viper"
1414

15-
"github.com/usememos/memos/internal/profile"
15+
"github.com/usem fmt.Println()
16+
fmt.Printf("Documentation: %s\n", "https://usememos.com")
17+
fmt.Printf("Source code: %s\n", "https://github.com/usememos/memos")
18+
fmt.Println("\nHappy note-taking!")/memos/internal/profile"
1619
"github.com/usememos/memos/internal/version"
1720
"github.com/usememos/memos/server"
1821
"github.com/usememos/memos/store"
1922
"github.com/usememos/memos/store/db"
2023
)
2124

22-
const (
23-
greetingBanner = `
24-
███╗ ███╗███████╗███╗ ███╗ ██████╗ ███████╗
25-
████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝
26-
██╔████╔██║█████╗ ██╔████╔██║██║ ██║███████╗
27-
██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║██║ ██║╚════██║
28-
██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║
29-
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
30-
`
31-
)
25+
3226

3327
var (
3428
rootCmd = &cobra.Command{
@@ -146,38 +140,37 @@ func init() {
146140
}
147141

148142
func printGreetings(profile *profile.Profile) {
143+
fmt.Printf("Memos %s started successfully!\n", profile.Version)
144+
149145
if profile.IsDev() {
150-
println("Development mode is enabled")
151-
println("DSN: ", profile.DSN)
146+
fmt.Fprintf(os.Stderr, "Development mode is enabled\n")
147+
if profile.DSN != "" {
148+
fmt.Fprintf(os.Stderr, "Database: %s\n", profile.DSN)
149+
}
152150
}
153-
fmt.Printf(`---
154-
Server profile
155-
version: %s
156-
data: %s
157-
addr: %s
158-
port: %d
159-
unix-sock: %s
160-
mode: %s
161-
driver: %s
162-
---
163-
`, profile.Version, profile.Data, profile.Addr, profile.Port, profile.UNIXSock, profile.Mode, profile.Driver)
164-
165-
print(greetingBanner)
151+
152+
// Server information
153+
fmt.Printf("Data directory: %s\n", profile.Data)
154+
fmt.Printf("Database driver: %s\n", profile.Driver)
155+
fmt.Printf("Mode: %s\n", profile.Mode)
156+
157+
// Connection information
166158
if len(profile.UNIXSock) == 0 {
167159
if len(profile.Addr) == 0 {
168-
fmt.Printf("Version %s has been started on port %d\n", profile.Version, profile.Port)
160+
fmt.Printf("Server running on port %d\n", profile.Port)
161+
fmt.Printf("Access your memos at: http://localhost:%d\n", profile.Port)
169162
} else {
170-
fmt.Printf("Version %s has been started on address '%s' and port %d\n", profile.Version, profile.Addr, profile.Port)
163+
fmt.Printf("Server running on %s:%d\n", profile.Addr, profile.Port)
164+
fmt.Printf("Access your memos at: http://%s:%d\n", profile.Addr, profile.Port)
171165
}
172166
} else {
173-
fmt.Printf("Version %s has been started on unix socket %s\n", profile.Version, profile.UNIXSock)
167+
fmt.Printf("Server running on unix socket: %s\n", profile.UNIXSock)
174168
}
175-
fmt.Printf(`---
176-
See more in:
177-
👉Website: %s
178-
👉GitHub: %s
179-
---
180-
`, "https://usememos.com", "https://github.com/usememos/memos")
169+
170+
fmt.Println()
171+
fmt.Printf("� Documentation: %s\n", "https://usememos.com")
172+
fmt.Printf("💻 Source code: %s\n", "https://github.com/usememos/memos")
173+
fmt.Println("\n✨ Happy note-taking!")
181174
}
182175

183176
func main() {

internal/util/util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package util
1+
package util //nolint:revive // util is an appropriate package name for utility functions
22

33
import (
44
"testing"

plugin/cron/parser.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,8 @@ func parseDescriptor(descriptor string, loc *time.Location) (Schedule, error) {
420420
Dow: all(dow),
421421
Location: loc,
422422
}, nil
423+
default:
424+
// Continue to check @every prefix below
423425
}
424426

425427
const every = "@every "

plugin/filter/common_converter.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ func (c *CommonSQLConverter) ConvertExprToSQL(ctx *ConvertContext, expr *exprv1.
4545
return c.handleInOperator(ctx, v.CallExpr)
4646
case "contains":
4747
return c.handleContainsOperator(ctx, v.CallExpr)
48+
default:
49+
return errors.Errorf("unsupported call expression function: %s", v.CallExpr.Function)
4850
}
4951
} else if v, ok := expr.ExprKind.(*exprv1.Expr_IdentExpr); ok {
5052
return c.handleIdentifier(ctx, v.IdentExpr)
@@ -144,9 +146,9 @@ func (c *CommonSQLConverter) handleComparisonOperator(ctx *ConvertContext, callE
144146
return c.handlePinnedComparison(ctx, operator, value)
145147
case "has_task_list", "has_link", "has_code", "has_incomplete_tasks":
146148
return c.handleBooleanComparison(ctx, identifier, operator, value)
149+
default:
150+
return errors.Errorf("unsupported identifier in comparison: %s", identifier)
147151
}
148-
149-
return nil
150152
}
151153

152154
func (c *CommonSQLConverter) handleSizeComparison(ctx *ConvertContext, callExpr *exprv1.Expr_Call, sizeCall *exprv1.Expr_Call) error {
@@ -567,6 +569,8 @@ func (c *CommonSQLConverter) handleBooleanComparison(ctx *ConvertContext, field,
567569
jsonPath = "$.property.hasCode"
568570
case "has_incomplete_tasks":
569571
jsonPath = "$.property.hasIncompleteTasks"
572+
default:
573+
return errors.Errorf("unsupported boolean field: %s", field)
570574
}
571575

572576
// Special handling for SQLite based on field

proto/gen/api/v1/activity_service.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/gen/api/v1/attachment_service.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/gen/api/v1/auth_service.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/gen/api/v1/common.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/gen/api/v1/idp_service.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/gen/api/v1/inbox_service.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)