From 122b9f5b40cf9317102ce6335458f8f8ecd10957 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 20 May 2024 12:47:41 +0300 Subject: [PATCH] docs: fix typos in comments --- README.md | 2 +- docs/badge.md | 14 +++++++------- pkg/testcoverage/badge.go | 2 +- pkg/testcoverage/check_test.go | 2 +- pkg/testcoverage/config.go | 4 ++-- pkg/testcoverage/coverage/cover_test.go | 6 +++--- pkg/testcoverage/testdata/consts.go | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 5546769..fbcc20a 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ steps: # Configure action by specifying input parameters individually (option 2). # If you are using config file (option 1) you shouldn't use these parameters, however - # specifting these action parameters will override appropriate config values. + # specifing these action parameters will override appropriate config values. profile: cover.out local-prefix: github.com/org/project threshold-file: 80 diff --git a/docs/badge.md b/docs/badge.md index d92f5be..e22cff1 100644 --- a/docs/badge.md +++ b/docs/badge.md @@ -22,8 +22,8 @@ Example: local-prefix: github.com/org/project threshold-total: 95 - ## when token is not specified (value '') this feature is turend off - ## in this example badge is created and committed only for main brach + ## when token is not specified (value '') this feature is turned off + ## in this example badge is created and committed only for main branch git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }} ## name of branch where badges are stored ## ideally this should be orphan branch (see below how to create this branch) @@ -72,11 +72,11 @@ Example: local-prefix: github.com/org/project threshold-total: 95 - ## when secret is not specified (value '') this feature is turend off. - ## in this example badge is created and uploaded only for main brach. + ## when secret is not specified (value '') this feature is turned off. + ## in this example badge is created and uploaded only for main branch. cdn-secret: ${{ github.ref_name == 'main' && secrets.CDN_SECRET || '' }} cdn-key: ${{ secrets.CDN_KEY }} - ## in case of DigitalOcean Spaces use `us-ease-1` always as reagion, + ## in case of DigitalOcean Spaces use `us-ease-1` always as region, ## otherwise use region of your CDN. cdn-region: us-east-1 ## in case of DigitalOcean Spaces endpoint should be with region and without bucket @@ -126,11 +126,11 @@ Example: ## format should be `{owner}/{repository}` git-repository: org/badges-repository ## use custom file name that will have repository name as prefix. - ## this could be usefull if you want to create badges for multiple repositories. + ## this could be useful if you want to create badges for multiple repositories. git-file-name: .badges/${{ github.repository }}/${{ github.ref_name }}/coverage.svg ``` -Like in the first example `badges` branch should be created with same method as described abow. +Like in the first example `badges` branch should be created with same method as described above. ## Badge examples diff --git a/pkg/testcoverage/badge.go b/pkg/testcoverage/badge.go index 7c86709..7b3632b 100644 --- a/pkg/testcoverage/badge.go +++ b/pkg/testcoverage/badge.go @@ -25,7 +25,7 @@ func generateAndSaveBadge(w io.Writer, cfg Config, totalCoverage int) error { out.Flush() if buffer.Len() != 0 { - // add visual sparator before writing result + // add visual separator before writing result // of generate and save badge action fmt.Fprintf(w, "\n-------------------------\n") w.Write(buffer.Bytes()) //nolint:errcheck // relax diff --git a/pkg/testcoverage/check_test.go b/pkg/testcoverage/check_test.go index deaeeb9..1e308f0 100644 --- a/pkg/testcoverage/check_test.go +++ b/pkg/testcoverage/check_test.go @@ -139,7 +139,7 @@ func TestCheck(t *testing.T) { Profile: profileOK, Threshold: Threshold{File: 10}, Badge: Badge{ - FileName: t.TempDir(), // should faild because this is dir + FileName: t.TempDir(), // should failed because this is dir }, } pass := Check(buf, cfg) diff --git a/pkg/testcoverage/config.go b/pkg/testcoverage/config.go index c065466..3bec7d6 100644 --- a/pkg/testcoverage/config.go +++ b/pkg/testcoverage/config.go @@ -110,7 +110,7 @@ func (c Config) validateThreshold() error { } func (c Config) validateCDN() error { - // when cnd config is empty, cnd featue is disabled and it's not need to validate + // when cnd config is empty, cnd feature is disabled and it's not need to validate if reflect.DeepEqual(c.Badge.CDN, badgestorer.CDN{}) { return nil } @@ -119,7 +119,7 @@ func (c Config) validateCDN() error { } func (c Config) validateGit() error { - // when git config is empty, git featue is disabled and it's not need to validate + // when git config is empty, git feature is disabled and it's not need to validate if reflect.DeepEqual(c.Badge.Git, badgestorer.Git{}) { return nil } diff --git a/pkg/testcoverage/coverage/cover_test.go b/pkg/testcoverage/coverage/cover_test.go index 703c957..7a32e05 100644 --- a/pkg/testcoverage/coverage/cover_test.go +++ b/pkg/testcoverage/coverage/cover_test.go @@ -68,7 +68,7 @@ func Test_GenerateCoverageStats(t *testing.T) { assert.NotContains(t, stats3[0].Name, prefix) assert.NotEqual(t, 100, CalcTotalStats(stats3).CoveredPercentage()) - // should have total coverage because of second profle + // should have total coverage because of second profile stats4, err := GenerateCoverageStats(Config{ Profiles: []string{profileOK, profileOKFull}, }) @@ -76,7 +76,7 @@ func Test_GenerateCoverageStats(t *testing.T) { assert.NotEmpty(t, stats4) assert.Equal(t, 100, CalcTotalStats(stats4).CoveredPercentage()) - // should not have `path/path.go` in statatistics because it has no statments + // should not have `path/path.go` in statistics because it has no statements stats5, err := GenerateCoverageStats(Config{ Profiles: []string{profileOKNoStatements}, }) @@ -114,7 +114,7 @@ func Test_findFile(t *testing.T) { assert.Error(t, err) } -func Test_findAnotations(t *testing.T) { +func Test_findAnnotations(t *testing.T) { t.Parallel() _, err := FindAnnotations(nil) diff --git a/pkg/testcoverage/testdata/consts.go b/pkg/testcoverage/testdata/consts.go index e805dfd..cc71c37 100644 --- a/pkg/testcoverage/testdata/consts.go +++ b/pkg/testcoverage/testdata/consts.go @@ -6,13 +6,13 @@ const ( // the most recent profile ProfileOK = "ok.profile" - // this profile is syntetically made with full coverage + // this profile is synthetically made with full coverage ProfileOKFull = "ok_full.profile" - // just like `ok.profile` but does not have entires for `path/path.go` file + // just like `ok.profile` but does not have entries for `path/path.go` file ProfileOKNoPath = "ok_no_path.profile" - // this profile has no statments for file + // this profile has no statements for file ProfileOKNoStatements = "ok_no_statements.profile" // contains profile item with invalid file