Skip to content

Commit 394e89a

Browse files
kylos101ona-agent
andcommitted
style: remove trailing whitespace
Co-authored-by: Ona <no-reply@ona.com>
1 parent d3b2318 commit 394e89a

22 files changed

Lines changed: 255 additions & 257 deletions

cmd/sign-cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Example:
3939
RunE: func(cmd *cobra.Command, args []string) error {
4040
manifestPath, _ := cmd.Flags().GetString("from-manifest")
4141
dryRun, _ := cmd.Flags().GetBool("dry-run")
42-
42+
4343
// Get max concurrency setting (env var as default, CLI flag overrides)
4444
maxConcurrency, _ := cmd.Flags().GetInt("max-signing-concurrency")
4545
if !cmd.Flags().Changed("max-signing-concurrency") {

pkg/leeway/build_checksum_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ func TestRecordArtifactChecksum(t *testing.T) {
1616
if err != nil {
1717
t.Fatal(err)
1818
}
19-
19+
2020
ctx := &buildContext{
2121
InFlightChecksums: true,
2222
artifactChecksums: make(map[string]string),
2323
}
24-
24+
2525
err = ctx.recordArtifactChecksum(testArtifact)
2626
if err != nil {
2727
t.Errorf("recordArtifactChecksum failed: %v", err)
2828
}
29-
29+
3030
if len(ctx.artifactChecksums) != 1 {
3131
t.Errorf("Expected 1 checksum, got %d", len(ctx.artifactChecksums))
3232
}
@@ -39,30 +39,30 @@ func TestVerifyArtifactChecksum(t *testing.T) {
3939
if err != nil {
4040
t.Fatal(err)
4141
}
42-
42+
4343
ctx := &buildContext{
4444
InFlightChecksums: true,
4545
artifactChecksums: make(map[string]string),
4646
}
47-
47+
4848
// Record initial checksum
4949
err = ctx.recordArtifactChecksum(testArtifact)
5050
if err != nil {
5151
t.Fatal(err)
5252
}
53-
53+
5454
// Verify unmodified file passes
5555
err = ctx.verifyArtifactChecksum(testArtifact)
5656
if err != nil {
5757
t.Errorf("Verification should pass for unmodified file: %v", err)
5858
}
59-
59+
6060
// Modify file to simulate TOCTU attack
6161
err = os.WriteFile(testArtifact, []byte("tampered content"), 0644)
6262
if err != nil {
6363
t.Fatal(err)
6464
}
65-
65+
6666
// Verify modified file fails with TOCTU message
6767
err = ctx.verifyArtifactChecksum(testArtifact)
6868
if err == nil {
@@ -78,13 +78,13 @@ func TestInFlightChecksumsDisabled(t *testing.T) {
7878
InFlightChecksums: false,
7979
artifactChecksums: nil,
8080
}
81-
81+
8282
// Both operations should be no-op
8383
err := ctx.recordArtifactChecksum("nonexistent")
8484
if err != nil {
8585
t.Errorf("Disabled checksumming should be no-op: %v", err)
8686
}
87-
87+
8888
err = ctx.verifyArtifactChecksum("nonexistent")
8989
if err != nil {
9090
t.Errorf("Disabled checksumming should be no-op: %v", err)
@@ -93,44 +93,44 @@ func TestInFlightChecksumsDisabled(t *testing.T) {
9393

9494
func TestVerifyAllArtifactChecksums(t *testing.T) {
9595
tmpDir := t.TempDir()
96-
96+
9797
// Create multiple test artifacts
9898
artifacts := []string{
9999
filepath.Join(tmpDir, "pkg1.tar.gz"),
100100
filepath.Join(tmpDir, "pkg2.tar.gz"),
101101
}
102-
102+
103103
ctx := &buildContext{
104104
InFlightChecksums: true,
105105
artifactChecksums: make(map[string]string),
106106
}
107-
107+
108108
// Record checksums for all artifacts
109109
for i, artifact := range artifacts {
110110
content := fmt.Sprintf("package %d content", i)
111111
err := os.WriteFile(artifact, []byte(content), 0644)
112112
if err != nil {
113113
t.Fatal(err)
114114
}
115-
115+
116116
err = ctx.recordArtifactChecksum(artifact)
117117
if err != nil {
118118
t.Fatal(err)
119119
}
120120
}
121-
121+
122122
// Verify all pass initially
123123
err := verifyAllArtifactChecksums(ctx)
124124
if err != nil {
125125
t.Errorf("All checksums should verify: %v", err)
126126
}
127-
127+
128128
// Tamper with one artifact
129129
err = os.WriteFile(artifacts[0], []byte("tampered!"), 0644)
130130
if err != nil {
131131
t.Fatal(err)
132132
}
133-
133+
134134
// Verification should fail
135135
err = verifyAllArtifactChecksums(ctx)
136136
if err == nil {
@@ -139,4 +139,4 @@ func TestVerifyAllArtifactChecksums(t *testing.T) {
139139
if !strings.Contains(err.Error(), "checksum verification failures") {
140140
t.Errorf("Expected verification failure message, got: %v", err)
141141
}
142-
}
142+
}

pkg/leeway/build_oci_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func TestCheckOCILayoutExists(t *testing.T) {
194194
for _, tt := range tests {
195195
t.Run(tt.name, func(t *testing.T) {
196196
tmpDir := t.TempDir()
197-
197+
198198
if err := tt.setup(tmpDir); err != nil {
199199
t.Fatalf("setup failed: %v", err)
200200
}

pkg/leeway/build_test.go

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,15 @@ func TestBuildDockerDeps(t *testing.T) {
193193

194194
func TestDockerExport_PrecedenceHierarchy(t *testing.T) {
195195
tests := []struct {
196-
name string
197-
packageConfig *bool // nil = not set, &true = true, &false = false
198-
workspaceEnvSet bool // Simulates workspace auto-set
199-
userEnvSet bool // Simulates user explicit set
200-
userEnvValue bool
201-
cliSet bool
202-
cliValue bool
203-
expectedFinal bool
204-
expectedSource string
196+
name string
197+
packageConfig *bool // nil = not set, &true = true, &false = false
198+
workspaceEnvSet bool // Simulates workspace auto-set
199+
userEnvSet bool // Simulates user explicit set
200+
userEnvValue bool
201+
cliSet bool
202+
cliValue bool
203+
expectedFinal bool
204+
expectedSource string
205205
}{
206206
{
207207
name: "No config, no overrides - global default",
@@ -232,19 +232,19 @@ func TestDockerExport_PrecedenceHierarchy(t *testing.T) {
232232
expectedSource: "package_config",
233233
},
234234
{
235-
name: "User env false - overrides package true",
236-
packageConfig: boolPtr(true),
237-
userEnvSet: true,
238-
userEnvValue: false,
239-
expectedFinal: false,
235+
name: "User env false - overrides package true",
236+
packageConfig: boolPtr(true),
237+
userEnvSet: true,
238+
userEnvValue: false,
239+
expectedFinal: false,
240240
expectedSource: "user_env_var",
241241
},
242242
{
243-
name: "User env true - overrides package false",
244-
packageConfig: boolPtr(false),
245-
userEnvSet: true,
246-
userEnvValue: true,
247-
expectedFinal: true,
243+
name: "User env true - overrides package false",
244+
packageConfig: boolPtr(false),
245+
userEnvSet: true,
246+
userEnvValue: true,
247+
expectedFinal: true,
248248
expectedSource: "user_env_var",
249249
},
250250
{
@@ -469,7 +469,6 @@ func TestBuildDocker_ExportToCache(t *testing.T) {
469469
}
470470
}
471471

472-
473472
func TestDockerPackage_BuildContextOverride(t *testing.T) {
474473
tests := []struct {
475474
name string
@@ -641,4 +640,3 @@ func TestDockerPostProcessing(t *testing.T) {
641640
test.Run()
642641
}
643642
}
644-

pkg/leeway/cache/remote/s3_provenance_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import (
1313
// TestS3Cache_ProvenanceUpload tests provenance bundle upload functionality
1414
func TestS3Cache_ProvenanceUpload(t *testing.T) {
1515
tests := []struct {
16-
name string
17-
createProvenanceFile bool
18-
provenanceContent string
19-
expectUpload bool
20-
expectedLogContains string
16+
name string
17+
createProvenanceFile bool
18+
provenanceContent string
19+
expectUpload bool
20+
expectedLogContains string
2121
}{
2222
{
2323
name: "successful provenance upload",
@@ -143,7 +143,7 @@ func TestS3Cache_ProvenanceDownload(t *testing.T) {
143143

144144
// Create mock package
145145
pkg := &mockPackage{
146-
146+
147147
version: "v1.0.0",
148148
}
149149

@@ -212,7 +212,7 @@ func TestS3Cache_ProvenanceRoundTrip(t *testing.T) {
212212

213213
// Create mock package
214214
pkg := &mockPackage{
215-
215+
216216
version: "v1.0.0",
217217
}
218218

@@ -281,7 +281,7 @@ func TestS3Cache_ProvenanceAtomicMove(t *testing.T) {
281281
tmpDir := t.TempDir()
282282

283283
pkg := &mockPackage{
284-
284+
285285
version: "v1.0.0",
286286
}
287287

0 commit comments

Comments
 (0)