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

docs: fix typos in comments #88

Merged
merged 1 commit into from
May 20, 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions docs/badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pkg/testcoverage/badge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/testcoverage/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pkg/testcoverage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/testcoverage/coverage/cover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ 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},
})
assert.NoError(t, err)
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},
})
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions pkg/testcoverage/testdata/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down