Skip to content

Commit 2485670

Browse files
Add codespell workflow (#421)
* feat: add codespell workflow * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: rename variables * chore: fix spellings * chore: fix spelling * chore: fix spellings * chore: fix spellings * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: undo variable renaming * chore: join `fmt.Print`s together * chore: add ignore list for words * fix: use correct property name * fix: change words to lowercase * fix: change `Print` to `Printf` Co-authored-by: Christian Clauss <cclauss@me.com> * chore: move workflow * chore: add codespell workflow here * Update .github/workflows/golang_lint_and_test.yml Co-authored-by: Christian Clauss <cclauss@me.com>
1 parent cc80617 commit 2485670

File tree

22 files changed

+36
-32
lines changed

22 files changed

+36
-32
lines changed

.github/workflows/golang_lint_and_test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ jobs:
88
fail-fast: false
99
steps:
1010
- uses: actions/checkout@v2
11+
- uses: codespell-project/actions-codespell@master
12+
with:
13+
ignore_words_list: "actualy,nwe"
14+
skip: "go.mod,go.sum"
1115
- uses: actions/setup-go@v2
1216
- run: go version
1317
- uses: golangci/golangci-lint-action@v2

cipher/polybius/polybius_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestNewPolybius(t *testing.T) {
5151
name: "truncate characters", size: 5, characters: "HogeFuga", key: "abcdefghijklmnopqrstuvwxy", wantErr: "",
5252
},
5353
{
54-
name: "invaid key", size: 5, characters: "HogeFuga", key: "abcdefghi", wantErr: "len(key): 9 must be as long as size squared: 25",
54+
name: "invalid key", size: 5, characters: "HogeFuga", key: "abcdefghi", wantErr: "len(key): 9 must be as long as size squared: 25",
5555
},
5656
{
5757
name: "invalid characters", size: 5, characters: "HogeH", key: "abcdefghijklmnopqrstuvwxy", wantErr: "\"chars\" contains same character: H",

cipher/rsa/rsa_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func TestEncryptDecrypt(t *testing.T) {
4747
e := int64(17) // Coprime with delta
4848

4949
if gcd.Recursive(e, delta) != 1 {
50-
t.Fatal("Algorithm failed in preamble stage:\n\tPrime numbers are chosed statically and it shouldn't fail at this stage")
50+
t.Fatal("Algorithm failed in preamble stage:\n\tPrime numbers are chosen statically and it shouldn't fail at this stage")
5151
}
5252

5353
d, err := modular.Inverse(e, delta)

conversion/binarytodecimal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Date: 19-Oct-2021
88
// https://en.wikipedia.org/wiki/Binary_number
99
// https://en.wikipedia.org/wiki/Decimal
1010
// Function receives a Binary Number as string and returns the Decimal number as integer.
11-
// Suppoted Binary number range is 0 to 2^(31-1).
11+
// Supported Binary number range is 0 to 2^(31-1).
1212

1313
// Package name.
1414
package conversion

conversion/decimaltobinary.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Date: 14-Oct-2021
77
// This algorithm will convert any Decimal (+ve integer) number to Binary number.
88
// https://en.wikipedia.org/wiki/Binary_number
99
// Function receives a integer as a Decimal number and returns the Binary number.
10-
// Suppoted integer value range is 0 to 2^(31 -1).
10+
// Supported integer value range is 0 to 2^(31 -1).
1111

1212
// Package name.
1313
package conversion

graph/topological.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ func Topological(N int, constraints [][]int) []int {
2222
edges[a][b] = true
2323
}
2424

25-
ans := []int{}
25+
answer := []int{}
2626
for s := 0; s < N; s++ {
2727
// Only start walking from top level nodes
2828
if dependencies[s] == 0 {
2929
route, _ := DepthFirstSearchHelper(s, N, nodes, edges, true)
30-
ans = append(ans, route...)
30+
answer = append(answer, route...)
3131
}
3232
}
3333

34-
return ans
34+
return answer
3535
}

math/geometry/straightlines.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func Distance(a, b *Point) float64 {
1818
return math.Sqrt(math.Pow(a.X-b.X, 2) + math.Pow(a.Y-b.Y, 2))
1919
}
2020

21-
// Calcualtes the Point that divides a line in specific ratio.
21+
// Calculates the Point that divides a line in specific ratio.
2222
// DO NOT specify the ratio in the form m:n, specify it as r, where r = m / n.
2323
func Section(p1, p2 *Point, r float64) Point {
2424
var point Point

other/maxsubarraysum/maxsubarraysum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
maximum contiguous sum in the given array. */
33

44
// Package maxsubarraysum is a package containing a solution to a common
5-
// problem of finding max contigious sum within a array of ints.
5+
// problem of finding max contiguous sum within a array of ints.
66
package maxsubarraysum
77

88
import (

other/nested/nestedbrackets.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Package nested provides functions for testing
2-
// strings propper brackets nesting.
2+
// strings proper brackets nesting.
33
package nested
44

55
// IsBalanced returns true if provided input string is properly nested.
@@ -16,7 +16,7 @@ package nested
1616
//
1717
// **Note** Providing characters other then brackets would return false,
1818
// despite brackets sequence in the string. Make sure to filter
19-
// input before useage.
19+
// input before usage.
2020
func IsBalanced(input string) bool {
2121
if len(input) == 0 {
2222
return true

search/ternary.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
// in the interval [a, b]. a and b should be finit numbers
1010
func TernaryMax(a, b, epsilon float64, f func(x float64) float64) (float64, error) {
1111
if a == math.Inf(-1) || b == math.Inf(1) {
12-
return -1, fmt.Errorf("interval boundries should be finite numbers")
12+
return -1, fmt.Errorf("interval boundaries should be finite numbers")
1313
}
1414
if math.Abs(a-b) <= epsilon {
1515
return f((a + b) / 2), nil
@@ -26,7 +26,7 @@ func TernaryMax(a, b, epsilon float64, f func(x float64) float64) (float64, erro
2626
// in the interval [a, b]. a and b should be finit numbers.
2727
func TernaryMin(a, b, epsilon float64, f func(x float64) float64) (float64, error) {
2828
if a == math.Inf(-1) || b == math.Inf(1) {
29-
return -1, fmt.Errorf("interval boundries should be finite numbers")
29+
return -1, fmt.Errorf("interval boundaries should be finite numbers")
3030
}
3131
if math.Abs(a-b) <= epsilon {
3232
return f((a + b) / 2), nil

0 commit comments

Comments
 (0)