chore: fix pre-existing gofmt and markdown lint issues

Markdown lint in CI now checks nested docs, which it previously skipped because the `**/*.md` glob was expanded by the shell without globstar.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-10-21 18:49:26 -04:00
1 parent 9dd14b7385
commit 398deb3beb
26 files changed
+124 -115

No files matched your search

+4 -4
View File
@@ -15,10 +15,10 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
var flags map[string]common.ReportFunc
if appName == "--global" {
flags = map[string]common.ReportFunc{
"--builder-global-selected": reportGlobalSelected,
"--builder-global-build-dir": reportGlobalBuildDir,
"--builder-global-skip-cleanup": reportGlobalSkipCleanup,
"--builder-computed-skip-cleanup": reportComputedSkipCleanup,
"--builder-global-selected": reportGlobalSelected,
"--builder-global-build-dir": reportGlobalBuildDir,
"--builder-global-skip-cleanup": reportGlobalSkipCleanup,
"--builder-computed-skip-cleanup": reportComputedSkipCleanup,
}
} else {
flags = map[string]common.ReportFunc{
@@ -36,7 +36,7 @@ func main() {
args.Parse(os.Args[2:])
appName := args.Arg(0)
if *branch == "" {
*branch = common.PropertyGet("git", appName, "deploy-branch")
*branch = common.PropertyGet("git", appName, "deploy-branch")
}
err = buildpacks.CommandDetect(appName, *branch)
case "list":
+3 -3
View File
@@ -39,9 +39,9 @@ func CommandDetect(appName string, branch string) (err error) {
workDir := common.AppRoot(appName)
checkedOutDir, err := checkoutBareGitRepo(workDir, branch)
if err != nil {
return err
}
if err != nil {
return err
}
defer func() {
if err := os.RemoveAll(checkedOutDir); err != nil {
common.LogWarn(fmt.Sprintf("Failed to remove temporary directory %s: %v", checkedOutDir, err))
+2 -2
View File
@@ -208,8 +208,8 @@ func TestReportSingleAppJSONNonPluginPrefixKey(t *testing.T) {
// Keys that don't start with --<reportType>- should pass through with
// only the leading "--" stripped, regardless of TrimPrefix.
infoFlags := map[string]string{
"--build-id": "abc123",
"--builds-retention": "5",
"--build-id": "abc123",
"--builds-retention": "5",
}
out := captureStdout(t, func() {
+6 -3
View File
@@ -154,9 +154,12 @@ func joinShellTokens(tokens []string) string {
// quoteShellArg returns s wrapped in single quotes when it contains characters
// the shell would otherwise interpret (whitespace, quotes, expansion sigils,
// globs, redirections, etc.). Embedded single quotes are escaped with the
// standard `'\''` close-escape-open sequence. Tokens free of such characters
// are returned verbatim so the stored representation stays human-readable for
// the common case.
// standard close-escape-open sequence:
//
// '\''
//
// Tokens free of such characters are returned verbatim so the stored
// representation stays human-readable for the common case.
func quoteShellArg(s string) string {
if s == "" {
return "''"
+39 -39
View File
@@ -22,43 +22,43 @@ func templatePath(t *testing.T) string {
func defaultVars() map[string]interface{} {
return map[string]interface{}{
"APP": "app",
"DOKKU_ROOT": "/home/dokku",
"DOKKU_LIB_ROOT": "/var/lib/dokku",
"NOSSL_SERVER_NAME": "app.example.com",
"SSL_SERVER_NAME": "",
"SSL_INUSE": "",
"APP_SSL_PATH": "/home/dokku/app/tls",
"DOKKU_APP_WEB_LISTENERS": "127.0.0.1:5000",
"PROXY_PORT_MAP": "http:80:5000",
"PROXY_UPSTREAM_PORTS": "5000",
"PROXY_PORT": "80",
"PROXY_SSL_PORT": "443",
"PROXY_KEEPALIVE": "",
"NGINX_BIND_ADDRESS_IP4": "",
"NGINX_BIND_ADDRESS_IP6": "::",
"NGINX_ACCESS_LOG_PATH": "/var/log/nginx/app-access.log",
"NGINX_ACCESS_LOG_FORMAT": "",
"NGINX_ERROR_LOG_PATH": "/var/log/nginx/app-error.log",
"NGINX_UNDERSCORE_IN_HEADERS": "off",
"CLIENT_BODY_TIMEOUT": "60s",
"CLIENT_HEADER_TIMEOUT": "60s",
"CLIENT_MAX_BODY_SIZE": "1m",
"KEEPALIVE_TIMEOUT": "75s",
"LINGERING_TIMEOUT": "5s",
"SEND_TIMEOUT": "60s",
"PROXY_CONNECT_TIMEOUT": "60s",
"PROXY_READ_TIMEOUT": "60s",
"PROXY_SEND_TIMEOUT": "60s",
"PROXY_BUFFER_SIZE": "4k",
"PROXY_BUFFERING": "on",
"PROXY_BUFFERS": "8 4k",
"PROXY_BUSY_BUFFERS_SIZE": "8k",
"PROXY_X_FORWARDED_FOR": "$remote_addr",
"PROXY_X_FORWARDED_PORT": "$server_port",
"PROXY_X_FORWARDED_PROTO": "$scheme",
"PROXY_X_FORWARDED_SSL": "",
"HTTP2_DIRECTIVE_SUPPORTED": "true",
"APP": "app",
"DOKKU_ROOT": "/home/dokku",
"DOKKU_LIB_ROOT": "/var/lib/dokku",
"NOSSL_SERVER_NAME": "app.example.com",
"SSL_SERVER_NAME": "",
"SSL_INUSE": "",
"APP_SSL_PATH": "/home/dokku/app/tls",
"DOKKU_APP_WEB_LISTENERS": "127.0.0.1:5000",
"PROXY_PORT_MAP": "http:80:5000",
"PROXY_UPSTREAM_PORTS": "5000",
"PROXY_PORT": "80",
"PROXY_SSL_PORT": "443",
"PROXY_KEEPALIVE": "",
"NGINX_BIND_ADDRESS_IP4": "",
"NGINX_BIND_ADDRESS_IP6": "::",
"NGINX_ACCESS_LOG_PATH": "/var/log/nginx/app-access.log",
"NGINX_ACCESS_LOG_FORMAT": "",
"NGINX_ERROR_LOG_PATH": "/var/log/nginx/app-error.log",
"NGINX_UNDERSCORE_IN_HEADERS": "off",
"CLIENT_BODY_TIMEOUT": "60s",
"CLIENT_HEADER_TIMEOUT": "60s",
"CLIENT_MAX_BODY_SIZE": "1m",
"KEEPALIVE_TIMEOUT": "75s",
"LINGERING_TIMEOUT": "5s",
"SEND_TIMEOUT": "60s",
"PROXY_CONNECT_TIMEOUT": "60s",
"PROXY_READ_TIMEOUT": "60s",
"PROXY_SEND_TIMEOUT": "60s",
"PROXY_BUFFER_SIZE": "4k",
"PROXY_BUFFERING": "on",
"PROXY_BUFFERS": "8 4k",
"PROXY_BUSY_BUFFERS_SIZE": "8k",
"PROXY_X_FORWARDED_FOR": "$remote_addr",
"PROXY_X_FORWARDED_PORT": "$server_port",
"PROXY_X_FORWARDED_PROTO": "$scheme",
"PROXY_X_FORWARDED_SSL": "",
"HTTP2_DIRECTIVE_SUPPORTED": "true",
}
}
@@ -266,8 +266,8 @@ func TestTemplate_XForwardedSSL(t *testing.T) {
func TestTemplate_NginxConfDIncludeAlways(t *testing.T) {
cases := []struct {
name string
mutate func(map[string]interface{})
name string
mutate func(map[string]interface{})
}{
{"http", func(v map[string]interface{}) {}},
{"http_redirect", func(v map[string]interface{}) {
-1
View File
@@ -4,7 +4,6 @@ import (
"fmt"
)
// PortMap is a struct that contains a scheme:host-port:container-port mapping
type PortMap struct {
// ContainerPort is the port on the container
+21 -21
View File
@@ -30,27 +30,27 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
}
} else {
flags = map[string]common.ReportFunc{
"--deployed": reportDeployed,
"--processes": reportProcesses,
"--ps-can-scale": reportCanScale,
"--ps-computed-dockerfile-start-cmd": reportComputedDockerfileStartCmd,
"--ps-computed-procfile-path": reportComputedProcfilePath,
"--ps-computed-restart-policy": reportComputedRestartPolicy,
"--ps-computed-skip-deploy": reportComputedSkipDeploy,
"--ps-computed-start-cmd": reportComputedStartCmd,
"--ps-computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds,
"--ps-dockerfile-start-cmd": reportDockerfileStartCmd,
"--ps-global-procfile-path": reportGlobalProcfilePath,
"--ps-global-restart-policy": reportGlobalRestartPolicy,
"--ps-global-skip-deploy": reportGlobalSkipDeploy,
"--ps-global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds,
"--ps-procfile-path": reportProcfilePath,
"--ps-restart-policy": reportRestartPolicy,
"--ps-skip-deploy": reportSkipDeploy,
"--ps-start-cmd": reportStartCmd,
"--ps-stop-timeout-seconds": reportStopTimeoutSeconds,
"--restore": reportRestore,
"--running": reportRunningState,
"--deployed": reportDeployed,
"--processes": reportProcesses,
"--ps-can-scale": reportCanScale,
"--ps-computed-dockerfile-start-cmd": reportComputedDockerfileStartCmd,
"--ps-computed-procfile-path": reportComputedProcfilePath,
"--ps-computed-restart-policy": reportComputedRestartPolicy,
"--ps-computed-skip-deploy": reportComputedSkipDeploy,
"--ps-computed-start-cmd": reportComputedStartCmd,
"--ps-computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds,
"--ps-dockerfile-start-cmd": reportDockerfileStartCmd,
"--ps-global-procfile-path": reportGlobalProcfilePath,
"--ps-global-restart-policy": reportGlobalRestartPolicy,
"--ps-global-skip-deploy": reportGlobalSkipDeploy,
"--ps-global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds,
"--ps-procfile-path": reportProcfilePath,
"--ps-restart-policy": reportRestartPolicy,
"--ps-skip-deploy": reportSkipDeploy,
"--ps-start-cmd": reportStartCmd,
"--ps-stop-timeout-seconds": reportStopTimeoutSeconds,
"--restore": reportRestore,
"--running": reportRunningState,
}
extraFlags := addStatusFlags(appName, infoFlag)
+5 -5
View File
@@ -41,11 +41,11 @@ func TestGetLowestNodeVersion(t *testing.T) {
}
cases := []struct {
name string
nodes []*corev1.Node
selector string
want string
wantErr string
name string
nodes []*corev1.Node
selector string
want string
wantErr string
}{
{
name: "single control-plane node returns its kubelet version",
+3 -3
View File
@@ -88,7 +88,7 @@ func TestMigrateChartPropertiesToMapFormatPreservesExistingNonOverlappingKeys(t
setupChartMigrationTest(t)
Expect(common.PropertyMapWrite("scheduler-k3s", "--global", "chart-overrides.cert-manager", map[string]string{
"installCRDs": "true",
"installCRDs": "true",
"service.annotations.prometheus.io/scrape": "true",
})).To(Succeed())
Expect(common.PropertyWrite("scheduler-k3s", "--global", "chart.cert-manager.installCRDs", "false")).To(Succeed())
@@ -99,9 +99,9 @@ func TestMigrateChartPropertiesToMapFormatPreservesExistingNonOverlappingKeys(t
got, err := common.PropertyMapGet("scheduler-k3s", "--global", "chart-overrides.cert-manager")
Expect(err).NotTo(HaveOccurred())
Expect(got).To(Equal(map[string]string{
"installCRDs": "false",
"installCRDs": "false",
"service.annotations.prometheus.io/scrape": "true",
"version": "1.13.3",
"version": "1.13.3",
}))
}