Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Enable and fix some checks - Pt1 #31

Merged
merged 9 commits into from
Dec 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: forbidigo
DownerCase committed Dec 16, 2024
commit 5a15ab6c45baf3ba88d329d0b257e882a392732d
3 changes: 1 addition & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -3,15 +3,14 @@ linters:
disable:
- exportloopref # Deprecated
- execinquery # Deprecated
- exhaustruct # Very noisy, hard to disable when want zero values
- gci
- forbidigo
- gocritic
- godox
- gomnd
- gochecknoglobals
- gosec
- ireturn
- exhaustruct
- mnd
- forcetypeassert
- nlreturn
4 changes: 2 additions & 2 deletions cmd/monitor/page_topics_messages.go
Original file line number Diff line number Diff line change
@@ -90,12 +90,12 @@ func (m *model_topic_messages) createSubscriber() {
subscriber, err := subscriber.New()
if err != nil {
subscriber.Delete()
fmt.Println("Failed to allocate new subscriber")
panic(fmt.Errorf("[Topic Messages]: %w", err))
}
err = subscriber.Create(m.mon.Topic_name, m.mon.Datatype)
if err != nil {
subscriber.Delete()
fmt.Println("Failed to create subscriber!")
panic(fmt.Errorf("[Topic Messages]: %w", err))
}
switch {
case m.mon.Datatype.Name == "std::string" && m.mon.Datatype.Encoding == "base":
6 changes: 2 additions & 4 deletions cmd/monitor/tea.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package main

import (
"fmt"
"os"
"log"
"strings"
"time"

@@ -130,7 +129,6 @@ func (m *model) View() string {
func doCli() {
p := tea.NewProgram(newModel())
if _, err := p.Run(); err != nil {
fmt.Println("Error running program:", err)
os.Exit(1)
log.Fatal("Error running program:", err)
}
}
4 changes: 2 additions & 2 deletions internal/protobuf/protobuf.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package protobuf

import (
"fmt"
"log"

"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protodesc"
@@ -65,7 +65,7 @@ func GetProtoMessageDescription(msg proto.Message) []byte {
getFileDescriptor(desc, &pset)
bytes, err := proto.Marshal(&pset)
if err != nil {
fmt.Println(err)
log.Println("WARN: GetProtoMessageDescription failed to marshal file descriptor set", err)
return nil
}
return bytes
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
@@ -15,8 +15,8 @@ import (

func main() {
// eCAL version as string and semantic version components
fmt.Println(ecal.GetVersionString())
fmt.Println(ecal.GetVersion())
fmt.Println(ecal.GetVersionString()) //nolint:forbidigo
fmt.Println(ecal.GetVersion()) //nolint:forbidigo

// Initialize eCAL with default config, the unit name "Go eCAL",
// and the Publisher, Subscriber and Logging components enabled
@@ -102,13 +102,13 @@ func receiveMessages(s *subscriber.Subscriber) {
for {
msg, err := s.Receive(2 * time.Second)
if err == nil {
fmt.Println("Received:", msg)
fmt.Println("Received:", msg) //nolint:forbidigo
} else {
fmt.Println(err)
fmt.Println(err) //nolint:forbidigo
}
}
}

func registrationLogger(id registration.TopicId, event registration.Event) {
fmt.Println("Received registration sample:", id)
fmt.Println("Received registration sample:", id) //nolint:forbidigo
}