Maintain consistency with established naming conventions throughout the codebase. When adding new flags, functions, or variables, examine existing similar implementations and follow the same patterns for naming, separators, and structure.
Maintain consistency with established naming conventions throughout the codebase. When adding new flags, functions, or variables, examine existing similar implementations and follow the same patterns for naming, separators, and structure.
Key areas to check:
--timestamps
not --timestamp
to match compose logs
)GetImageNameOrDefault
instead of GetDefaultImageName
when reading existing values first)-
for resource names, :
for label formatting)streams
not dockerCli
when type is api.Streams
)Example from codebase:
// Consistent with existing logs command
flags.BoolVar(&up.timestamps, "timestamps", false, "Show timestamps.")
// Descriptive function name that matches behavior
func GetImageNameOrDefault(service types.ServiceConfig, projectName string) string {
if service.Image != "" {
return service.Image
}
return projectName + "-" + service.Name // Use consistent separator
}
Before introducing new naming, search the codebase for similar functionality and adopt the established patterns to maintain consistency and reduce cognitive load for developers.
Enter the URL of a public GitHub repository