Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typos suggestion #11

Merged
merged 2 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
gotaskr (Go-Task-Runner) is a generic task runner which is invoked via CLI.

The tasks are written in plain Go and can easily be called from the CLI.
This is especially usefull for tasks in the CI.
This is especially useful for tasks in the CI.

The tasks can be chained and in the end, there is a statistic about
the tasks that were executed and their runtime.
Expand All @@ -25,11 +25,11 @@ There are some inbuilt helpers for often used things for various DevOps tasks.
- [Setup and Teardown methods](../../wiki/Lifetime-Methods)
- Output from subprocesses directly visible
- [Inbuilt helpers](../../wiki/Tools) for various DevOps tasks
- [VSCode Plugin](https://marketplace.visualstudio.com/items?itemName=Roemer.gotaskr-vscode) to easily run tasks with a single click
- [VS Code Plugin](https://marketplace.visualstudio.com/items?itemName=Roemer.gotaskr-vscode) to easily run tasks with a single click
- Even works in existing go repositories (see [build](build) from this repository as an example)

## Visual Studio Code Extension
gotaskr has a corresponding Visual Studio Code extension that allows easily running or even debugging tasks directly from Visual Studio Code. It also allows to add arguments when running or debugging them.
gotaskr has a corresponding Visual Studio Code extension that allows easily running or even debugging tasks directly from Visual Studio Code. It also allows adding arguments when running or debugging them.

Example:

Expand Down
2 changes: 1 addition & 1 deletion execr/execr.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package execr is a wapper to run exec commands.
// Package execr is a wrapper to run exec commands.
package execr

import (
Expand Down
4 changes: 2 additions & 2 deletions goext/goext.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func Ternary[T any](cond bool, vtrue, vfalse T) T {
return vfalse
}

// Printfln allows to use Printf and Println in one call.
// Printfln allows using Printf and Println in one call.
func Printfln(format string, a ...any) (n int, err error) {
text := fmt.Sprintf(format, a...)
return fmt.Println(text)
Expand All @@ -33,7 +33,7 @@ func Noop() error {
}

// Pass is a no-op function that can be used to set variables to used.
// Usefull during development but must be removed afterwards!
// Useful during development but must be removed afterwards!
func Pass(i ...interface{}) {
// No-Op
}
8 changes: 4 additions & 4 deletions goext/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type RunOption interface {
revert() error
}

// Runs a given method with addiitional options.
// Runs a given method with additional options.
func RunWithOptions(f func() error, options ...RunOption) (err error) {
// Apply the options
for _, option := range options {
Expand All @@ -34,7 +34,7 @@ func RunWithOptions(f func() error, options ...RunOption) (err error) {
return
}

// Runs a given method with returns one parameter with addiitional options.
// Runs a given method with returns one parameter with additional options.
func RunWithOptions1P[P1 any](f func() (P1, error), options ...RunOption) (P1, error) {
var p1 P1
return p1, RunWithOptions(func() error {
Expand All @@ -44,7 +44,7 @@ func RunWithOptions1P[P1 any](f func() (P1, error), options ...RunOption) (P1, e
}, options...)
}

// Runs a given method with returns two parameters with addiitional options.
// Runs a given method with returns two parameters with additional options.
func RunWithOptions2P[P1 any, P2 any](f func() (P1, P2, error), options ...RunOption) (P1, P2, error) {
var p1 P1
var p2 P2
Expand All @@ -55,7 +55,7 @@ func RunWithOptions2P[P1 any, P2 any](f func() (P1, P2, error), options ...RunOp
}, options...)
}

// Runs a given method with returns three parameters with addiitional options.
// Runs a given method with returns three parameters with additional options.
func RunWithOptions3P[P1 any, P2 any, P3 any](f func() (P1, P2, P3, error), options ...RunOption) (P1, P2, P3, error) {
var p1 P1
var p2 P2
Expand Down
2 changes: 1 addition & 1 deletion goext/slice_extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func AppendIf[T any](slice []T, cond bool, values ...T) []T {
return slice
}

// Appends the given value if the condition is fulfilled. Calculates the value to add only if the condition is fulfulled.
// Appends the given value if the condition is fulfilled. Calculates the value to add only if the condition is fulfilled.
func AppendIfFunc[T any](slice []T, cond bool, f func() []T) []T {
if cond {
values := f()
Expand Down
18 changes: 9 additions & 9 deletions gotaskr.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import (
"github.com/roemer/gotaskr/log"
)

// Generate a map that holds all passed arguments from the cli
// Generate a map that holds all passed arguments from the CLI
var argumentsMap = argparse.ParseArgs()

// Prepare a map for all the task objects
var taskMap map[string]*TaskObject = make(map[string]*TaskObject)

// Prepare a list of the task names. Used to print the tasks in order
// Prepare a list of the task names. Used to print the tasks in order.
var taskList []string

// Prepare an array for the tasks that were run (in run order)
Expand Down Expand Up @@ -118,7 +118,7 @@ func Execute() int {
log.Information()
printTaskRuns()

// If the teardown failed but nothing else, still fail with the teardowns error
// If the teardown failed but nothing else, still fail with the teardown error
if teardownErr != nil && exitCode == 0 {
exitCode = getExitCodeFromError(teardownErr)
}
Expand All @@ -143,7 +143,7 @@ func GetArgumentOrDefault(argName string, defaultValue string) (string, bool) {
return defaultValue, false
}

// HasArgument returns true if an arument was set and false otherwise, regardless of the value.
// HasArgument returns true if an argument was set and false otherwise, regardless of the value.
func HasArgument(argName string) bool {
_, exist := GetArgument(argName)
return exist
Expand Down Expand Up @@ -215,7 +215,7 @@ func RunTarget(target string) error {
// Run the task teardown method
teardownErr := runLifetimeFunc("TaskTeardown", context.TaskTeardownFunc)

// If the teardown failed but nothing else, still fail with the teardowns error
// If the teardown failed but nothing else, still fail with the teardown error
if teardownErr != nil && taskErr == nil {
return teardownErr
}
Expand Down Expand Up @@ -251,7 +251,7 @@ func runLifetimeFunc(lifetimeStage string, function func() error) error {
log.Informationf("--- %s %s", lifetimeStage, strings.Repeat("-", 60-5-len(lifetimeStage)))
err := runFuncRecover(function)
if err != nil {
log.Informationf("Error occured: %v", err)
log.Informationf("Error occurred: %v", err)
return err
}
return nil
Expand Down Expand Up @@ -322,10 +322,10 @@ type TaskObject struct {
description string // The description of the task.
arguments []argument // The arguments of the task.
taskFunc func() error // The function of the task.
dependencies []string // A list of dependecy tasks.
dependencies []string // A list of dependency tasks.
dependees []string // A list of dependee tasks.
followups []string // A list of followup tasks.
continueOnError bool // A flag to incdicate if the run should continue when an error occured.
continueOnError bool // A flag to indicate if the run should continue when an error occurred.
deferOnError bool // A flag to indicate if the error should be deferred until the end.
didRun bool // A flag to indicate if the task did already run.
duration time.Duration // A runtime duration of the task if it ran already.
Expand Down Expand Up @@ -441,7 +441,7 @@ func (taskObject *TaskObject) Argument(argumentName string, argumentDescription
return taskObject
}

// AddFollowupTask allows to add one or more tasks that should run after the current finished.
// AddFollowupTask allows adding one or more tasks that should run after the current finished.
func AddFollowupTask(taskName ...string) {
currentRunningTask.Then(taskName...)
}
Expand Down
18 changes: 9 additions & 9 deletions gttools/cypress.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ const (
// Also see https://docs.cypress.io/guides/guides/command-line#cypress-run
type CypressRunSettings struct {
ToolSettingsBase
Browser string // defines the browser to launch like chrome, chromium, edge, electron, firefox. Alternatively a path to an executable.
Browser string // defines the browser to launch like Chrome, Chromium, Edge, Electron, Firefox. Alternatively a path to an executable.
CiBuildId string // the unique id to group tests together.
Component bool // flag to define if component tests should run.
Config string // specify the config to use. Defined as key value pairs, comma separated. Can alsop be a stringified json object.
Config string // specify the config to use. Defined as key value pairs, comma separated. Can also be a stringified JSON object.
ConfigFile string // the path to a config file to use.
E2e bool // flag to define if end to end tests should run (default).
Env map[string]string // environment variables to use.
Expand All @@ -44,9 +44,9 @@ type CypressRunSettings struct {
Port int // override the default port.
Project string // the path to a specific project to run.
Quiet bool // flag to indicate the quite mode where no output is passed to stdout.
Record bool // flag to indicate if the tests shouldbe recorded or not.
Reporter string // define the reporter to use. Can be any of the mocha, cypress or a custom reporter.
ReporterOptions string // specify the reporter options to use as key value pairs, comma separated. Can also be a stringified json object.
Record bool // flag to indicate if the tests should be recorded or not.
Reporter string // define the reporter to use. Can be any of the Mocha, Cypress or a custom reporter.
ReporterOptions string // specify the reporter options to use as key value pairs, comma separated. Can also be a stringified JSON object.
Specs []string // define the spec file(s) to run.
Tags []string // add tags to identify a run.
}
Expand All @@ -55,9 +55,9 @@ type CypressRunSettings struct {
// Also see https://docs.cypress.io/guides/guides/command-line#cypress-open
type CypressOpenSettings struct {
ToolSettingsBase
Browser string // defines the browser to launch like chrome, chromium, edge, electron, firefox. Alternatively a path to an executable.
Browser string // defines the browser to launch like chrome, Chromium, Edge, Electron, Firefox. Alternatively a path to an executable.
Component bool // flag to define if component tests should run.
Config string // specify the config to use. Defined as key value pairs, comma separated. Can alsop be a stringified json object.
Config string // specify the config to use. Defined as key value pairs, comma separated. Can also be a stringified JSON object.
ConfigFile string // the path to a config file to use.
Detached bool // flag to define if Cypress should open in detached mode.
E2e bool // flag to define if end to end tests should run (default).
Expand Down Expand Up @@ -87,15 +87,15 @@ func (settings *CypressRunSettings) AddSpecs(specs ...string) *CypressRunSetting
return settings
}

// AddTags adds one or more tagst to the Cypress settings.
// AddTags adds one or more tags to the Cypress settings.
func (settings *CypressRunSettings) AddTags(tags ...string) *CypressRunSettings {
for _, entry := range tags {
settings.Tags = goext.AppendIfMissing(settings.Tags, entry)
}
return settings
}

// CypressRun allows you to run Cypress with a defined binary. Usefull for example when using cy2.
// CypressRun allows you to run Cypress with a defined binary. Useful for example when using cy2.
func (tool *CypressTool) CypressRun(cypressBinPath string, settings *CypressRunSettings) error {
return cypressExecute(cypressBinPath, settings.buildCliArguments(), settings.ToolSettingsBase)
}
Expand Down
2 changes: 1 addition & 1 deletion gttools/devcontainer_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ type DevContainerCliFeaturesPublishSettings struct {
Target string
// Name of the OCI registry.
Registry string
// Unique indentifier for the collection of features.
// Unique identifier for the collection of features.
Namespace string
// Log level.
LogLevel DevContainerCliLogLevel
Expand Down
2 changes: 1 addition & 1 deletion gttools/eslint.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type EsLintMessage struct {
EndColumn int64 `json:"endColumn"`
}

// ParseEsLintReport parses the given eslint report (json).
// ParseEsLintReport parses the given eslint report (JSON).
func (tool *EsLintTool) ParseEsLintReport(esLintReportPath string) (*EsLintReport, error) {
jsonFile, err := os.Open(esLintReportPath)
if err != nil {
Expand Down
16 changes: 8 additions & 8 deletions gttools/flyway.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ type FlywaySettings struct {
ToolPath string

//// Connection
// The jdbc url to use to connect to the database.
// The JDBC URL to use to connect to the database.
Url string
// The user to use to connect to the database.
User string
// The password to use to connect to the database.
Password string
// The fully qualified class name of the jdbc driver to use to connect to the database.
// The fully qualified class name of the JDBC driver to use to connect to the database.
Driver string
// The maximum number of retries when attempting to connect to the database.
ConnectRetries *int
Expand Down Expand Up @@ -60,17 +60,17 @@ type FlywaySettings struct {
FailOnMissingLocations *bool
// At the start of a migration, Flyway will attempt to take a lock to prevent competing instances executing in parallel.
LockRetryCount *int
// Allows you to override Flyway's logging auto-detection and specify one or multiple loggers to use.
// Allows you to override Flyway's logging autodetection and specify one or multiple loggers to use.
Loggers []FlywayLogger
// Whether to allow mixing transactional and non-transactional statements within the same migration.
Mixed *bool
// Allows migrations to be run "out of order".
OutOfOrder *bool
// Filename for the report file.
ReportFilename string
// Whether default built-in callbacks (sql) should be skipped.
// Whether default built-in callbacks (SQL) should be skipped.
SkipDefaultCallbacks *bool
// Whether default built-in resolvers (sql and jdbc) should be skipped.
// Whether default built-in resolvers (SQL and JDBC) should be skipped.
SkipDefaultResolvers *bool
// The name of Flyway's schema history table.
Table string
Expand All @@ -82,7 +82,7 @@ type FlywaySettings struct {
WorkingDirectory string

//// Schema
// Whether Flyway should attempt to create the schemas specified in the schemas property.
// Whether Flyway should attempt to create the schemas specified in the schemas' property.
CreateSchemas *bool
// The default schema managed by Flyway.
DefaultSchema string
Expand Down Expand Up @@ -114,7 +114,7 @@ type FlywaySettings struct {
Resolvers []string
// The file name prefix for versioned SQL migrations.
SqlMigrationPrefix string
// The file name separator for Sql migrations.
// The file name separator for SQL migrations.
SqlMigrationSeparator string
// List of file name suffixes for SQL migrations.
SqlMigrationSuffixes []string
Expand All @@ -138,7 +138,7 @@ type FlywaySettings struct {
OutputType FlywayOutputType

//// PostgreSQL
// Whether or not transactional advisory locks should be used with PostgreSQL.
// Whether transactional advisory locks should be used with PostgreSQL.
PostgresqlTransactionalLock *bool
}

Expand Down
6 changes: 3 additions & 3 deletions gttools/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func CreateGitLabTool() *GitLabTool {
}

// GitLabReport defines the data for the quality report for GitLab.
// See https://docs.gitlab.com/ee/ci/testing/code_quality.html#implementing-a-custom-tool for details
// See https://docs.gitlab.com/ee/ci/testing/code_quality.html#implementing-a-custom-tool for details.
type GitLabReport struct {
Entries []*GitLabCodeQualityEntry
}
Expand All @@ -35,7 +35,7 @@ type GitLabCodeQualityLines struct {
End int64 `json:"end"`
}

// IsRunningOnGitLab returns a flag, if we are currently running on gitlab
// IsRunningOnGitLab returns a flag, if we are currently running on GitLab.
func (tool *GitLabTool) IsRunningOnGitLab() bool {
return goext.EnvExists("GITLAB_CI")
}
Expand Down Expand Up @@ -76,7 +76,7 @@ func (tool *GitLabTool) MergeGitLabReports(gitLabReports []*GitLabReport) *GitLa
return gitLabReport
}

// WriteGitLabReport writes the GitLabReport into a json file.
// WriteGitLabReport writes the GitLabReport into a JSON file.
func (tool *GitLabTool) WriteGitLabReport(gitLabReport *GitLabReport, outputFilePath string) error {
return goext.WriteJsonToFile(gitLabReport.Entries, outputFilePath, true)
}
2 changes: 1 addition & 1 deletion gttools/gttools.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func CreateToolsClient() *ToolsClient {
}
}

// ToolSettingsBase are common settings usefull for all tools that run executables.
// ToolSettingsBase are common settings useful for all tools that run executables.
type ToolSettingsBase struct {
WorkingDirectory string // the path to use as working directory when running the tool
OutputToConsole bool // flag to define if the output of the tool should be written into the console or not.
Expand Down
2 changes: 1 addition & 1 deletion gttools/nx.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ type NxShowProjectsSettings struct {
WithTarget string // Show only projects that have a specific target.
}

// ShowProjects returns projects according to the given criterias.
// ShowProjects returns projects according to the given criteria.
func (tool *NxTool) ShowProjects(runType NxRunType, settings NxShowProjectsSettings) ([]string, error) {
args := []string{"projects"}
args = goext.AppendIf(args, settings.Affected, "--affected")
Expand Down
Loading