From 1155d8961dd5260b0c3d35bb7bbb54f1420dd00a Mon Sep 17 00:00:00 2001 From: Alan Davidson Date: Thu, 2 Jan 2025 16:12:52 -0500 Subject: [PATCH] remove trailing whitespace from CLI files --- cli/module_generate/_templates/go/models/tmpl-module.go | 6 +++--- cli/module_generate/_templates/go/run.sh | 2 +- cli/module_generate/_templates/go/tmpl-Makefile | 6 +++--- cli/module_generate/_templates/go/tmpl-go.mod | 2 +- cli/module_generate/_templates/go/tmpl-main.go | 2 +- cli/module_generate/scripts/generate_stubs.py | 2 +- cli/module_generate/scripts/tmpl-module | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cli/module_generate/_templates/go/models/tmpl-module.go b/cli/module_generate/_templates/go/models/tmpl-module.go index 09ceaaf3b1c..a589a764e09 100644 --- a/cli/module_generate/_templates/go/models/tmpl-module.go +++ b/cli/module_generate/_templates/go/models/tmpl-module.go @@ -21,7 +21,7 @@ type Config struct { /* Put config attributes here. There should be public/exported fields with a `json` parameter at the end of each attribute. - + Example config struct: type Config struct { Pin string `json:"pin"` @@ -29,7 +29,7 @@ type Config struct { MinDeg *float64 `json:"min_angle_deg,omitempty"` } - If your model does not need a config, replace *Config in the init + If your model does not need a config, replace *Config in the init function with resource.NoNativeConfig */ @@ -38,7 +38,7 @@ type Config struct { // resource.TriviallyValidateConfig } -// Validate ensures all parts of the config are valid and important fields exist. +// Validate ensures all parts of the config are valid and important fields exist. // Returns implicit dependencies based on the config. // The path is the JSON path in your robot's config (not the `Config` struct) to the // resource being validated; e.g. "components.0". diff --git a/cli/module_generate/_templates/go/run.sh b/cli/module_generate/_templates/go/run.sh index 97fd032a409..81418259ce2 100644 --- a/cli/module_generate/_templates/go/run.sh +++ b/cli/module_generate/_templates/go/run.sh @@ -6,7 +6,7 @@ export PATH=$PATH:$(go env GOPATH)/bin echo "Downloading necessary go packages..." -if ! ( +if ! ( go get go.viam.com/rdk@latest > /dev/null 2>&1 go get golang.org/x/tools/cmd/goimports@latest > /dev/null 2>&1 gofmt -w -s . diff --git a/cli/module_generate/_templates/go/tmpl-Makefile b/cli/module_generate/_templates/go/tmpl-Makefile index 7829bb0d647..e5729981fcd 100644 --- a/cli/module_generate/_templates/go/tmpl-Makefile +++ b/cli/module_generate/_templates/go/tmpl-Makefile @@ -2,7 +2,7 @@ BIN_OUTPUT_PATH = bin TOOL_BIN = bin/gotools/$(shell uname -s)-$(shell uname -m) UNAME_S ?= $(shell uname -s) GOPATH = $(HOME)/go/bin -export PATH := ${PATH}:$(GOPATH) +export PATH := ${PATH}:$(GOPATH) build: format update-rdk rm -f $(BIN_OUTPUT_PATH)/{{ .ModuleName}} @@ -12,7 +12,7 @@ module.tar.gz: build rm -f $(BIN_OUTPUT_PATH)/module.tar.gz tar czf $(BIN_OUTPUT_PATH)/module.tar.gz $(BIN_OUTPUT_PATH)/{{ .ModuleName}} -setup: +setup: if [ "$(UNAME_S)" = "Linux" ]; then \ sudo apt-get install -y apt-utils coreutils tar libnlopt-dev libjpeg-dev pkg-config; \ fi @@ -26,7 +26,7 @@ clean: format: gofmt -w -s . - + update-rdk: go get go.viam.com/rdk@latest go mod tidy diff --git a/cli/module_generate/_templates/go/tmpl-go.mod b/cli/module_generate/_templates/go/tmpl-go.mod index 3f0e5c94edc..84d2ddfdb61 100644 --- a/cli/module_generate/_templates/go/tmpl-go.mod +++ b/cli/module_generate/_templates/go/tmpl-go.mod @@ -1,3 +1,3 @@ module {{.ModuleName}} -go 1.23 +go 1.23 diff --git a/cli/module_generate/_templates/go/tmpl-main.go b/cli/module_generate/_templates/go/tmpl-main.go index f53cf1a5f48..5e2c56c3193 100644 --- a/cli/module_generate/_templates/go/tmpl-main.go +++ b/cli/module_generate/_templates/go/tmpl-main.go @@ -19,7 +19,7 @@ func mainWithArgs(ctx context.Context, args []string, logger logging.Logger) err if err != nil { return err } - + if err = {{.ModuleCamel}}.AddModelFromRegistry(ctx, {{.ResourceSubtype}}.API, models.{{.ModelPascal}}); err != nil { return err } diff --git a/cli/module_generate/scripts/generate_stubs.py b/cli/module_generate/scripts/generate_stubs.py index 276886915eb..72a076ff55a 100644 --- a/cli/module_generate/scripts/generate_stubs.py +++ b/cli/module_generate/scripts/generate_stubs.py @@ -47,7 +47,7 @@ def replace_async_func( ast.Raise( exc=ast.Call(func=ast.Name(id='NotImplementedError', ctx=ast.Load()), - args=[], + args=[], keywords=[]), cause=None) ] diff --git a/cli/module_generate/scripts/tmpl-module b/cli/module_generate/scripts/tmpl-module index c8b861a7368..870f303cfd0 100644 --- a/cli/module_generate/scripts/tmpl-module +++ b/cli/module_generate/scripts/tmpl-module @@ -22,7 +22,7 @@ type Config struct { /* Put config attributes here. There should be public/exported fields with a `json` parameter at the end of each attribute. - + Example config struct: type Config struct { Pin string `json:"pin"` @@ -30,7 +30,7 @@ type Config struct { MinDeg *float64 `json:"min_angle_deg,omitempty"` } - If your model does not need a config, replace *Config in the init + If your model does not need a config, replace *Config in the init function with resource.NoNativeConfig */ @@ -39,7 +39,7 @@ type Config struct { // resource.TriviallyValidateConfig } -// Validate ensures all parts of the config are valid and important fields exist. +// Validate ensures all parts of the config are valid and important fields exist. // Returns implicit dependencies based on the config. // The path is the JSON path in your robot's config (not the `Config` struct) to the // resource being validated; e.g. "components.0".