From 0db86bc6a4b2a499cf74ed18cbc627e486a62d0e Mon Sep 17 00:00:00 2001 From: GitCaddy Date: Wed, 14 Jan 2026 09:41:16 +0000 Subject: [PATCH] chore: Fix linter issues and update copyrights MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Format Go files with gofmt - Update copyrights to include MarketAlly - Add MarketAlly copyright to files we created 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- internal/app/cmd/cmd.go | 3 +-- internal/app/poll/poller.go | 2 +- internal/pkg/artifact/upload_helper.go | 4 ++-- internal/pkg/cleanup/cleanup.go | 1 - internal/pkg/envcheck/capabilities.go | 18 +++++++++--------- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/internal/app/cmd/cmd.go b/internal/app/cmd/cmd.go index ab92fd5..8cac1c4 100644 --- a/internal/app/cmd/cmd.go +++ b/internal/app/cmd/cmd.go @@ -1,4 +1,4 @@ -// Copyright 2022 The Gitea Authors. All rights reserved. +// Copyright 2022 The Gitea Authors and MarketAlly. All rights reserved. // SPDX-License-Identifier: MIT package cmd @@ -80,7 +80,6 @@ func Execute(ctx context.Context) { cacheCmd.Flags().Uint16VarP(&cacheArgs.Port, "port", "p", 0, "Port of the cache server") rootCmd.AddCommand(cacheCmd) - // ./gitcaddy-runner cleanup cleanupCmd := &cobra.Command{ Use: "cleanup", diff --git a/internal/app/poll/poller.go b/internal/app/poll/poller.go index ee763bb..ee6499d 100644 --- a/internal/app/poll/poller.go +++ b/internal/app/poll/poller.go @@ -1,4 +1,4 @@ -// Copyright 2023 The Gitea Authors. All rights reserved. +// Copyright 2023 The Gitea Authors and MarketAlly. All rights reserved. // SPDX-License-Identifier: MIT package poll diff --git a/internal/pkg/artifact/upload_helper.go b/internal/pkg/artifact/upload_helper.go index 6b8bf9f..a0dee9e 100644 --- a/internal/pkg/artifact/upload_helper.go +++ b/internal/pkg/artifact/upload_helper.go @@ -114,7 +114,7 @@ func (u *UploadHelper) doUpload(client *http.Client, url, token, filepath string if err != nil { return fmt.Errorf("failed to create form file: %w", err) } - + if _, err := io.Copy(part, file); err != nil { return fmt.Errorf("failed to copy file to form: %w", err) } @@ -124,7 +124,7 @@ func (u *UploadHelper) doUpload(client *http.Client, url, token, filepath string if err != nil { return fmt.Errorf("failed to create request: %w", err) } - + req.Header.Set("Authorization", fmt.Sprintf("token %s", token)) req.Header.Set("Content-Type", writer.FormDataContentType()) req.Header.Set("Connection", "keep-alive") diff --git a/internal/pkg/cleanup/cleanup.go b/internal/pkg/cleanup/cleanup.go index ff4de09..121e2d4 100644 --- a/internal/pkg/cleanup/cleanup.go +++ b/internal/pkg/cleanup/cleanup.go @@ -261,7 +261,6 @@ func dirSize(path string) int64 { return size } - // cleanBuildCaches removes old build tool caches that accumulate from CI jobs // These are cleaned more aggressively (files older than 7 days) since they can grow very large func cleanBuildCaches(maxAge time.Duration) (int64, int, error) { diff --git a/internal/pkg/envcheck/capabilities.go b/internal/pkg/envcheck/capabilities.go index aaa6da4..408d807 100644 --- a/internal/pkg/envcheck/capabilities.go +++ b/internal/pkg/envcheck/capabilities.go @@ -1,4 +1,4 @@ -// Copyright 2026 The Gitea Authors. All rights reserved. +// Copyright 2026 MarketAlly. All rights reserved. // SPDX-License-Identifier: MIT package envcheck @@ -19,7 +19,7 @@ import ( // DiskInfo holds disk space information type DiskInfo struct { - Path string `json:"path,omitempty"` // Path being checked (working directory) + Path string `json:"path,omitempty"` // Path being checked (working directory) Total uint64 `json:"total_bytes"` Free uint64 `json:"free_bytes"` Used uint64 `json:"used_bytes"` @@ -28,11 +28,11 @@ type DiskInfo struct { // CPUInfo holds CPU load information type CPUInfo struct { - NumCPU int `json:"num_cpu"` // Number of logical CPUs - LoadAvg1m float64 `json:"load_avg_1m"` // 1-minute load average - LoadAvg5m float64 `json:"load_avg_5m"` // 5-minute load average - LoadAvg15m float64 `json:"load_avg_15m"` // 15-minute load average - LoadPercent float64 `json:"load_percent"` // (load_avg_1m / num_cpu) * 100 + NumCPU int `json:"num_cpu"` // Number of logical CPUs + LoadAvg1m float64 `json:"load_avg_1m"` // 1-minute load average + LoadAvg5m float64 `json:"load_avg_5m"` // 5-minute load average + LoadAvg15m float64 `json:"load_avg_15m"` // 15-minute load average + LoadPercent float64 `json:"load_percent"` // (load_avg_1m / num_cpu) * 100 } // DistroInfo holds Linux distribution information @@ -46,7 +46,7 @@ type DistroInfo struct { type XcodeInfo struct { Version string `json:"version,omitempty"` Build string `json:"build,omitempty"` - SDKs []string `json:"sdks,omitempty"` // e.g., ["iOS 17.0", "macOS 14.0"] + SDKs []string `json:"sdks,omitempty"` // e.g., ["iOS 17.0", "macOS 14.0"] Simulators []string `json:"simulators,omitempty"` // Available iOS simulators } @@ -61,7 +61,7 @@ type RunnerCapabilities struct { ContainerRuntime string `json:"container_runtime,omitempty"` Shell []string `json:"shell,omitempty"` Tools map[string][]string `json:"tools,omitempty"` - BuildTools []string `json:"build_tools,omitempty"` // Available build/installer tools + BuildTools []string `json:"build_tools,omitempty"` // Available build/installer tools PackageManagers []string `json:"package_managers,omitempty"` Features *CapabilityFeatures `json:"features,omitempty"` Limitations []string `json:"limitations,omitempty"`