Skip to content

Commit 9701042

Browse files
committed
format: fixing whitespace in files
Both 'trailing-whitespace' and 'end-of-file-fixer' hooks are applied. They remove unnecessary trailing whitespace and ensure that files end with a newline. Part of #TNTP-2937 PreCommit-Verified: Passed
1 parent b22dfb0 commit 9701042

File tree

60 files changed

+95
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+95
-129
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ Closes #XXX
2020
[go-testing]: https://pkg.go.dev/testing
2121
[how-to-write-commit]: https://www.tarantool.io/en/doc/latest/contributing/developer_guidelines/#how-to-write-a-commit-message
2222
[keepachangelog]: https://keepachangelog.com/en/1.0.0/
23-
[tarantoolbot-example]: https://github.com/tarantool/tt/pull/1030/commits
23+
[tarantoolbot-example]: https://github.com/tarantool/tt/pull/1030/commits

ci/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ RUN wget -P /tmp/ https://github.com/openssl/openssl/releases/download/openssl-3
6464
&& tar -xvf /tmp/openssl-3.0.8.tar.gz -C /tmp/ \
6565
&& cd /tmp/openssl-3.0.8 \
6666
&& ./Configure --prefix=/opt/openssl no-shared \
67-
&& make -j \
67+
&& make -j \
6868
&& make install \
6969
&& rm -rf /tmp/*
7070

@@ -77,4 +77,4 @@ RUN ETCD_VER=v3.5.9 \
7777

7878
RUN curl -L https://tarantool.io/iqJapRm/release/3/installer.sh | bash \
7979
&& apt install -y tarantool tarantool-dev \
80-
&& apt clean
80+
&& apt clean

cli/cartridge/extra/001_make_cmd_public.patch

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ index 5a37a75..77fdb4e 100644
55
@@ -9,6 +9,8 @@ import (
66
"github.com/tarantool/cartridge-cli/cli/admin"
77
)
8-
8+
99
+var CartridgeCliAdmin *cobra.Command
1010
+
1111
func init() {
@@ -14,10 +14,10 @@ index 5a37a75..77fdb4e 100644
1414
@@ -27,6 +29,7 @@ Otherwise, first available socket from all <run-dir>/<app-name>.*.control is use
1515
DisableFlagParsing: true,
1616
}
17-
17+
1818
+ CartridgeCliAdmin = adminCmd
1919
rootCmd.AddCommand(adminCmd)
20-
20+
2121
// FLAGS are parsed in runAdminCommand
2222
diff --git a/cli/commands/bench.go b/cli/commands/bench.go
2323
index 8e408a6..06d85f0 100644
@@ -26,7 +26,7 @@ index 8e408a6..06d85f0 100644
2626
@@ -6,6 +6,8 @@ import (
2727
"github.com/tarantool/cartridge-cli/cli/bench"
2828
)
29-
29+
3030
+var CartridgeCliBench *cobra.Command
3131
+
3232
func init() {
@@ -38,7 +38,7 @@ index 8e408a6..06d85f0 100644
3838
}
3939
+ CartridgeCliBench = benchCmd
4040
rootCmd.AddCommand(benchCmd)
41-
41+
4242
configureFlags(benchCmd)
4343
diff --git a/cli/commands/build.go b/cli/commands/build.go
4444
index 5d444d3..127ea43 100644
@@ -47,7 +47,7 @@ index 5d444d3..127ea43 100644
4747
@@ -7,6 +7,8 @@ import (
4848
"github.com/tarantool/cartridge-cli/cli/build"
4949
)
50-
50+
5151
+var CartridgeCliBuild *cobra.Command
5252
+
5353
func init() {
@@ -56,10 +56,10 @@ index 5d444d3..127ea43 100644
5656
@@ -21,6 +23,7 @@ func init() {
5757
},
5858
}
59-
59+
6060
+ CartridgeCliBuild = buildCmd
6161
rootCmd.AddCommand(buildCmd)
62-
62+
6363
// FLAGS
6464
diff --git a/cli/commands/create.go b/cli/commands/create.go
6565
index 468f0ab..c3b5730 100644
@@ -68,7 +68,7 @@ index 468f0ab..c3b5730 100644
6868
@@ -13,6 +13,8 @@ import (
6969
"github.com/tarantool/cartridge-cli/cli/create/templates"
7070
)
71-
71+
7272
+var CartridgeCliCreate *cobra.Command
7373
+
7474
func init() {
@@ -77,32 +77,32 @@ index 468f0ab..c3b5730 100644
7777
@@ -27,6 +29,7 @@ func init() {
7878
},
7979
}
80-
80+
8181
+ CartridgeCliCreate = createCmd
8282
rootCmd.AddCommand(createCmd)
83-
83+
8484
// FLAGS
8585
diff --git a/cli/commands/failover.go b/cli/commands/failover.go
8686
index 02c9c4d..ca58ad1 100644
8787
--- a/cli/commands/failover.go
8888
+++ b/cli/commands/failover.go
8989
@@ -9,7 +9,8 @@ import (
9090
)
91-
91+
9292
var (
9393
- failoverModes = []string{"stateful", "eventual", "disabled", "raft"}
9494
+ failoverModes = []string{"stateful", "eventual", "disabled", "raft"}
9595
+ CartridgeCliFailover *cobra.Command
9696
)
97-
97+
9898
func init() {
9999
@@ -18,6 +19,7 @@ func init() {
100100
Short: "Manage application failover",
101101
}
102-
102+
103103
+ CartridgeCliFailover = failoverCmd
104104
rootCmd.AddCommand(failoverCmd)
105-
105+
106106
var setupCmd = &cobra.Command{
107107
diff --git a/cli/commands/pack.go b/cli/commands/pack.go
108108
index 39ada3a..d6e389a 100644
@@ -111,7 +111,7 @@ index 39ada3a..d6e389a 100644
111111
@@ -200,6 +200,8 @@ The supported types are: rpm, tgz, docker, deb`,
112112
},
113113
}
114-
114+
115115
+var CartridgeCliPack = packCmd
116116
+
117117
func runPackCommand(cmd *cobra.Command, args []string) error {
@@ -124,18 +124,18 @@ index 174e489..3348257 100644
124124
@@ -9,12 +9,15 @@ import (
125125
"github.com/tarantool/cartridge-cli/cli/repair"
126126
)
127-
127+
128128
+var CartridgeCliRepair *cobra.Command
129129
+
130130
func init() {
131131
var repairCmd = &cobra.Command{
132132
Use: "repair",
133133
Short: "Patch cluster configuration files",
134134
}
135-
135+
136136
+ CartridgeCliRepair = repairCmd
137137
rootCmd.AddCommand(repairCmd)
138-
138+
139139
// repair sub-commands
140140
diff --git a/cli/commands/replicasets.go b/cli/commands/replicasets.go
141141
index 6e000b8..661c926 100644
@@ -144,16 +144,16 @@ index 6e000b8..661c926 100644
144144
@@ -8,12 +8,15 @@ import (
145145
"github.com/tarantool/cartridge-cli/cli/replicasets"
146146
)
147-
147+
148148
+var CartridgeCliReplica *cobra.Command
149149
+
150150
func init() {
151151
var replicasetsCmd = &cobra.Command{
152152
Use: "replicasets",
153153
Short: "Manage application replica sets",
154154
}
155-
155+
156156
+ CartridgeCliReplica = replicasetsCmd
157157
rootCmd.AddCommand(replicasetsCmd)
158-
158+
159159
// replicasets sub-commands

cli/cartridge/extra/002_fix_admin_param.patch

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ index 77fdb4e..9a9ed38 100644
44
+++ b/cli/commands/admin.go
55
@@ -46,7 +46,7 @@ func addAdminFlags(flagSet *pflag.FlagSet) {
66
flagSet.BoolVarP(&ctx.Admin.Help, "help", "h", false, "Help for admin function")
7-
7+
88
flagSet.StringVar(&ctx.Admin.InstanceName, "instance", "", "Instance to connect to")
99
- flagSet.StringVarP(&ctx.Admin.ConnString, "conn", "c", "", "Address to connect to")
1010
+ flagSet.StringVar(&ctx.Admin.ConnString, "conn", "", "Address to connect to")
11-
11+
1212
flagSet.StringVar(&ctx.Running.RunDir, "run-dir", "", prodRunDirUsage)
13-

cli/cartridge/extra/003_fix_work_paths.patch

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ index dcea75c..9058c16 100644
33
--- a/cli/admin/common.go
44
+++ b/cli/admin/common.go
55
@@ -2,7 +2,6 @@ package admin
6-
6+
77
import (
88
"fmt"
99
- "io/ioutil"
@@ -13,7 +13,7 @@ index dcea75c..9058c16 100644
1313
@@ -140,31 +139,30 @@ func getInstanceSocketPaths(ctx *context.Ctx) ([]string, error) {
1414
return nil, fmt.Errorf("%s is not a directory", ctx.Running.RunDir)
1515
}
16-
16+
1717
- runFiles, err := ioutil.ReadDir(ctx.Running.RunDir)
1818
- if err != nil {
1919
- return nil, fmt.Errorf("Failed to list the run directory: %s", err)
@@ -24,7 +24,7 @@ index dcea75c..9058c16 100644
2424
- }
2525
-
2626
instanceSocketPaths := []string{}
27-
27+
2828
- appInstanceSocketPrefix := fmt.Sprintf("%s.", ctx.Project.Name)
2929
- controlSocketSuffix := ".control"
3030
- for _, runFile := range runFiles {
@@ -62,7 +62,7 @@ index dcea75c..9058c16 100644
6262
+ if err != nil {
6363
+ return nil, err
6464
}
65-
65+
6666
if len(instanceSocketPaths) == 0 {
6767
diff --git a/cli/commands/create.go b/cli/commands/create.go
6868
index c3b5730..1282c47 100644
@@ -74,10 +74,10 @@ index c3b5730..1282c47 100644
7474
"github.com/tarantool/cartridge-cli/cli/create/templates"
7575
+ "github.com/tarantool/cartridge-cli/cli/project"
7676
)
77-
77+
7878
var CartridgeCliCreate *cobra.Command
7979
@@ -50,7 +51,7 @@ func runCreateCommand(cmd *cobra.Command, args []string) error {
80-
80+
8181
// get project path
8282
basePath := cmd.Flags().Arg(0)
8383
- ctx.Project.Path, err = getNewProjectPath(basePath)
@@ -88,11 +88,11 @@ index c3b5730..1282c47 100644
8888
@@ -76,9 +77,14 @@ func runCreateCommand(cmd *cobra.Command, args []string) error {
8989
return nil
9090
}
91-
91+
9292
-func getNewProjectPath(basePath string) (string, error) {
9393
+func getNewProjectPath(basePath string, instPath string) (string, error) {
9494
var err error
95-
95+
9696
+ // Parameter `instances_available` from tt.yaml has a priority.
9797
+ if instPath != "" {
9898
+ basePath = instPath
@@ -107,12 +107,12 @@ index 4e1a12f..bd576d0 100644
107107
+++ b/cli/project/files.go
108108
@@ -52,7 +52,7 @@ type FlagOpts struct {
109109
}
110-
110+
111111
func GetInstanceID(ctx *context.Ctx, instanceName string) string {
112112
- return fmt.Sprintf("%s.%s", ctx.Project.Name, instanceName)
113113
+ return fmt.Sprintf("%s/%s", instanceName, instanceName)
114114
}
115-
115+
116116
func GetInstanceWorkDir(ctx *context.Ctx, instanceName string) string {
117117
diff --git a/cli/project/project.go b/cli/project/project.go
118118
index d06ad10..551e56a 100644
@@ -121,12 +121,12 @@ index d06ad10..551e56a 100644
121121
@@ -11,6 +11,8 @@ import (
122122
"github.com/tarantool/cartridge-cli/cli/version"
123123
)
124-
124+
125125
+const EnvInstAvailable = "TT_INST_AVAILABLE"
126126
+
127127
func FillCtx(ctx *context.Ctx) error {
128128
var err error
129-
129+
130130
@@ -23,8 +25,17 @@ func FillCtx(ctx *context.Ctx) error {
131131
if err != nil {
132132
return fmt.Errorf("Failed to get current directory: %s", err)
@@ -138,7 +138,7 @@ index d06ad10..551e56a 100644
138138
+ if instAvail != "" {
139139
+ ctx.Running.AppDir = filepath.Join(instAvail, ctx.Project.Name)
140140
}
141-
141+
142142
+ ctx.Replicasets.File = filepath.Join(ctx.Running.AppDir, "replicasets.yml")
143143
+ ctx.Running.ConfPath = filepath.Join(ctx.Running.AppDir, "instances.yml")
144144
+

cli/cartridge/extra/004_fix_warning.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ index 9b56d17..e16dd14 100644
55
@@ -136,10 +136,6 @@ func (process *Process) SetPidAndStatus() {
66
return
77
}
8-
8+
99
- if name != "tarantool" {
1010
- log.Warnf("Process %s does not seem to be tarantool", name)
1111
- }

cli/cartridge/extra/005_rename_tt_env.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ index 1282c47..0432ba6 100644
33
--- a/cli/commands/create.go
44
+++ b/cli/commands/create.go
55
@@ -51,7 +51,7 @@ func runCreateCommand(cmd *cobra.Command, args []string) error {
6-
6+
77
// get project path
88
basePath := cmd.Flags().Arg(0)
99
- ctx.Project.Path, err = getNewProjectPath(basePath, os.Getenv(project.EnvInstAvailable))
@@ -18,22 +18,22 @@ index 551e56a..0a5227d 100644
1818
@@ -11,7 +11,7 @@ import (
1919
"github.com/tarantool/cartridge-cli/cli/version"
2020
)
21-
21+
2222
-const EnvInstAvailable = "TT_INST_AVAILABLE"
2323
+const EnvInstEnabled = "TT_INST_ENABLED"
24-
24+
2525
func FillCtx(ctx *context.Ctx) error {
2626
var err error
2727
@@ -28,9 +28,9 @@ func FillCtx(ctx *context.Ctx) error {
2828
ctx.Running.AppDir = filepath.Join(ctx.Running.AppDir, ctx.Project.Name)
2929
}
30-
30+
3131
- instAvail := os.Getenv(EnvInstAvailable)
3232
- if instAvail != "" {
3333
- ctx.Running.AppDir = filepath.Join(instAvail, ctx.Project.Name)
3434
+ instEnabled := os.Getenv(EnvInstEnabled)
3535
+ if instEnabled != "" {
3636
+ ctx.Running.AppDir = filepath.Join(instEnabled, ctx.Project.Name)
3737
}
38-
38+
3939
ctx.Replicasets.File = filepath.Join(ctx.Running.AppDir, "replicasets.yml")

cli/cartridge/extra/006_consider_tt_run_dir.patch

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ index 71b8f4f..e83efc0 100644
44
+++ b/cli/commands/admin.go
55
@@ -1,6 +1,7 @@
66
package commands
7-
7+
88
import (
99
+ "os"
1010
"path/filepath"
1111
"strings"
12-
12+
1313
@@ -8,6 +9,7 @@ import (
1414
"github.com/spf13/cobra"
1515
"github.com/spf13/pflag"
1616
"github.com/tarantool/cartridge-cli/cli/admin"
1717
+ "github.com/tarantool/cartridge-cli/cli/project"
1818
)
19-
19+
2020
var CartridgeCliAdmin *cobra.Command
2121
@@ -74,6 +76,11 @@ func runAdminCommand(cmd *cobra.Command, args []string) error {
2222
return err
@@ -28,22 +28,22 @@ index 71b8f4f..e83efc0 100644
2828
+ ctx.Running.RunDir = filepath.Join(runDir, ctx.Project.Name)
2929
+ }
3030
}
31-
31+
3232
// log level is usually set in rootCmd.PersistentPreRun
3333
diff --git a/cli/project/project.go b/cli/project/project.go
3434
index 2eed9cb..3d3a995 100644
3535
--- a/cli/project/project.go
3636
+++ b/cli/project/project.go
3737
@@ -12,6 +12,7 @@ import (
3838
)
39-
39+
4040
const EnvInstEnabled = "TT_INST_ENABLED"
4141
+const EnvRunDir = "TT_RUN_DIR"
42-
42+
4343
func FillCtx(ctx *context.Ctx) error {
4444
var err error
4545
@@ -30,7 +31,20 @@ func FillCtx(ctx *context.Ctx) error {
46-
46+
4747
instEnabled := os.Getenv(EnvInstEnabled)
4848
if instEnabled != "" {
4949
- ctx.Running.AppDir = filepath.Join(instEnabled, ctx.Project.Name)
@@ -62,5 +62,5 @@ index 2eed9cb..3d3a995 100644
6262
+ appName := filepath.Base(ctx.Running.AppDir)
6363
+ ctx.Running.RunDir = filepath.Join(runDir, appName)
6464
}
65-
65+
6666
ctx.Replicasets.File = filepath.Join(ctx.Running.AppDir, "replicasets.yml")

0 commit comments

Comments
 (0)