Repository: danvergara/dblab
Pull request #52 (2021-06-26 05:17:04)

fix(dblab): typos
# Pull Request Template

## Description

Fix typos

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] I have checked my code and corrected any misspellings



Patch:
diff --git a/Makefile b/Makefile
index 980c43e..1c2dfc2 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ int-test:
 	docker-compose run --entrypoint=make dblab test
 
 .PHONY: linter
-## linter: Runs the colangci-lint command
+## linter: Runs the golangci-lint command
 linter:
 	golangci-lint run --enable=golint --enable=godot ./...
 
diff --git a/cmd/root.go b/cmd/root.go
index e261b98..a3eb9d7 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -29,7 +29,7 @@ var (
 func NewRootCmd() *cobra.Command {
 	return &cobra.Command{
 		Use:   "dblab",
-		Short: "Interactive databse client",
+		Short: "Interactive database client",
 		Long:  `dblab is a terminal UI based interactive database client for Postgres, MySQL and SQLite.`,
 		RunE: func(cmd *cobra.Command, args []string) error {
 			var opts command.Options
diff --git a/db/seeds/seeder.go b/db/seeds/seeder.go
index 2856a2d..b1fca37 100644
--- a/db/seeds/seeder.go
+++ b/db/seeds/seeder.go
@@ -48,7 +48,7 @@ func Execute(db *sqlx.DB, driver string, seedMethodNames ...string) {
 func seed(s Seed, seedMethodName string) {
 	// Get the reflect value of the method.
 	m := reflect.ValueOf(s).MethodByName(seedMethodName)
-	// Exit if the method diesn't exist.
+	// Exit if the method doesn't exist.
 	if !m.IsValid() {
 		log.Fatal("no method called", seedMethodName)
 	}
@@ -56,5 +56,5 @@ func seed(s Seed, seedMethodName string) {
 	// Execute the method.
 	log.Println("seeding", seedMethodName, "...")
 	m.Call(nil)
-	log.Println("seed", seedMethodName, "succeded")
+	log.Println("seed", seedMethodName, "succeed")
 }
diff --git a/pkg/client/client.go b/pkg/client/client.go
index 76835fc..1941c6d 100644
--- a/pkg/client/client.go
+++ b/pkg/client/client.go
@@ -39,7 +39,7 @@ func New(opts command.Options) (*Client, error) {
 	return &c, nil
 }
 
-// Query returns performs the query and returns the result set and the colum names.
+// Query returns performs the query and returns the result set and the column names.
 func (c *Client) Query(q string, args ...interface{}) ([][]string, []string, error) {
 	resultSet := [][]string{}
 
diff --git a/pkg/connection/connection.go b/pkg/connection/connection.go
index 13c462d..20c13f0 100644
--- a/pkg/connection/connection.go
+++ b/pkg/connection/connection.go
@@ -15,10 +15,10 @@ var (
 	// ErrCantDetectUSer is the error used to notify that a default username is not found
 	// in the system to be used as database username.
 	ErrCantDetectUSer = errors.New("could not detect default username")
-	// ErrInvalidUPostgresRLFormat is the error used to notify that the postgres given url is not valid.
-	ErrInvalidUPostgresRLFormat = errors.New("invalid URL - Valid format: postgres://user:password@host:port/db?sslmode=mode")
-	// ErrInvalidUMySQLRLFormat is the error used to notify that the given mysql url is not valid.
-	ErrInvalidUMySQLRLFormat = errors.New("invalid URL - valid format: mysql://user:password@tcp(host:port)/db")
+	// ErrInvalidPostgresURLFormat is the error used to notify that the postgres given url is not valid.
+	ErrInvalidPostgresURLFormat = errors.New("invalid URL - Valid format: postgres://user:password@host:port/db?sslmode=mode")
+	// ErrInvalidMySQLURLFormat is the error used to notify that the given mysql url is not valid.
+	ErrInvalidMySQLURLFormat = errors.New("invalid URL - valid format: mysql://user:password@tcp(host:port)/db")
 	// ErrInvalidURLFormat is used to notify the url is invalid.
 	ErrInvalidURLFormat = errors.New("invalid url")
 	// ErrInvalidDriver is used to notify that the provided driver is not supported.
@@ -88,13 +88,13 @@ func currentUser() (string, error) {
 
 // formatPostgresURL returns valid uri for postgres connection.
 func formatPostgresURL(opts command.Options) (string, error) {
-	if !hasValidPosgresPrefix(opts.URL) {
-		return "", fmt.Errorf("invalid prefix %s : %w", opts.URL, ErrInvalidUPostgresRLFormat)
+	if !hasValidPostgresPrefix(opts.URL) {
+		return "", fmt.Errorf("invalid prefix %s : %w", opts.URL, ErrInvalidPostgresURLFormat)
 	}
 
 	uri, err := url.Parse(opts.URL)
 	if err != nil {
-		return "", fmt.Errorf("%v : %w", err, ErrInvalidUPostgresRLFormat)
+		return "", fmt.Errorf("%v : %w", err, ErrInvalidPostgresURLFormat)
 	}
 
 	result := map[string]string{}
@@ -124,7 +124,7 @@ func formatPostgresURL(opts command.Options) (string, error) {
 // formatMySQLURL returns valid uri for mysql connection.
 func formatMySQLURL(opts command.Options) (string, error) {
 	if !hasValidMySQLPrefix(opts.URL) {
-		return "", fmt.Errorf("%s, %w", opts.URL, ErrInvalidUMySQLRLFormat)
+		return "", fmt.Errorf("%s, %w", opts.URL, ErrInvalidMySQLURLFormat)
 	}
 
 	if strings.Contains(opts.URL, "3306") {
@@ -133,7 +133,7 @@ func formatMySQLURL(opts command.Options) (string, error) {
 
 	uri, err := url.Parse(opts.URL)
 	if err != nil {
-		return "", fmt.Errorf("%v %w", err, ErrInvalidUMySQLRLFormat)
+		return "", fmt.Errorf("%v %w", err, ErrInvalidMySQLURLFormat)
 	}
 
 	result := map[string]string{}
@@ -150,8 +150,8 @@ func formatMySQLURL(opts command.Options) (string, error) {
 	return uri.String(), nil
 }
 
-// hasValidPosgresPrefix checks if a given url has the driver name in it.
-func hasValidPosgresPrefix(rawurl string) bool {
+// hasValidPostgresPrefix checks if a given url has the driver name in it.
+func hasValidPostgresPrefix(rawurl string) bool {
 	return strings.HasPrefix(rawurl, "postgres://") || strings.HasPrefix(rawurl, "postgresql://")
 }
 
diff --git a/pkg/gui/database_helpers.go b/pkg/gui/database_helpers.go
index bec5399..53b5300 100644
--- a/pkg/gui/database_helpers.go
+++ b/pkg/gui/database_helpers.go
@@ -64,7 +64,7 @@ func (gui *Gui) inputQuery() func(g *gocui.Gui, v *gocui.View) error {
 	}
 }
 
-// selectTable perfoms a select statement based on the selected table.
+// selectTable performs a select statement based on the selected table.
 func (gui *Gui) selectTable(g *gocui.Gui, v *gocui.View) error {
 	v.Rewind()
 
diff --git a/scripts/entrypoint-mysql.dev.sh b/scripts/entrypoint-mysql.dev.sh
index c7654b5..30e487c 100755
--- a/scripts/entrypoint-mysql.dev.sh
+++ b/scripts/entrypoint-mysql.dev.sh
@@ -10,7 +10,7 @@ done
 
 echo "MySQL started"
 
-echo "Runinng the migrations against the DB"
+echo "Running the migrations against the DB"
 go run cmd/dbmigrate/main.go
 
 echo "Seeding the database"
diff --git a/scripts/entrypoint.dev.sh b/scripts/entrypoint.dev.sh
index ba7f842..3712e95 100755
--- a/scripts/entrypoint.dev.sh
+++ b/scripts/entrypoint.dev.sh
@@ -10,7 +10,7 @@ done
 
 echo "PostgreSQL started"
 
-echo "Runinng the migrations against the DB"
+echo "Running the migrations against the DB"
 go run cmd/dbmigrate/main.go
 
 echo "Seeding the database"


Test patch:
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 1add711..0c7f80b 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -34,7 +34,7 @@ jobs:
   lint:
     runs-on: ubuntu-latest
     steps:
-      # Installs go using a sigle version.
+      # Installs go using a single version.
       - name: Install Go
         uses: actions/setup-go@v2
         with:
diff --git a/pkg/connection/connection_test.go b/pkg/connection/connection_test.go
index 6f84385..5dcaaa6 100644
--- a/pkg/connection/connection_test.go
+++ b/pkg/connection/connection_test.go
@@ -69,7 +69,7 @@ func TestBuildConnectionFromOptsFromURL(t *testing.T) {
 			},
 			want: want{
 				hasError: true,
-				err:      ErrInvalidUPostgresRLFormat,
+				err:      ErrInvalidPostgresURLFormat,
 			},
 		},
 		{
@@ -82,7 +82,7 @@ func TestBuildConnectionFromOptsFromURL(t *testing.T) {
 			},
 			want: want{
 				hasError: true,
-				err:      ErrInvalidUPostgresRLFormat,
+				err:      ErrInvalidPostgresURLFormat,
 			},
 		},
 		// mysql
@@ -132,7 +132,7 @@ func TestBuildConnectionFromOptsFromURL(t *testing.T) {
 			},
 			want: want{
 				hasError: true,
-				err:      ErrInvalidUMySQLRLFormat,
+				err:      ErrInvalidMySQLURLFormat,
 			},
 		},
 		{
@@ -145,7 +145,7 @@ func TestBuildConnectionFromOptsFromURL(t *testing.T) {
 			},
 			want: want{
 				hasError: true,
-				err:      ErrInvalidUMySQLRLFormat,
+				err:      ErrInvalidMySQLURLFormat,
 			},
 		},
 	}
@@ -353,7 +353,7 @@ func TestFormatPostgresURL(t *testing.T) {
 			},
 			want: want{
 				hasError: true,
-				err:      ErrInvalidUPostgresRLFormat,
+				err:      ErrInvalidPostgresURLFormat,
 			},
 		},
 		{
@@ -366,7 +366,7 @@ func TestFormatPostgresURL(t *testing.T) {
 			},
 			want: want{
 				hasError: true,
-				err:      ErrInvalidUPostgresRLFormat,
+				err:      ErrInvalidPostgresURLFormat,
 			},
 		},
 	}
@@ -453,7 +453,7 @@ func TestFormatMySQLURL(t *testing.T) {
 			},
 			want: want{
 				hasError: true,
-				err:      ErrInvalidUMySQLRLFormat,
+				err:      ErrInvalidMySQLURLFormat,
 			},
 		},
 		{
@@ -466,7 +466,7 @@ func TestFormatMySQLURL(t *testing.T) {
 			},
 			want: want{
 				hasError: true,
-				err:      ErrInvalidUMySQLRLFormat,
+				err:      ErrInvalidMySQLURLFormat,
 			},
 		},
 	}
diff --git a/scripts/test_all.sh b/scripts/test_all.sh
index 3b26ba7..385c739 100755
--- a/scripts/test_all.sh
+++ b/scripts/test_all.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Integartion testing with dockerized database servers
+# Integration testing with dockerized database servers
 #
 
 set -e