Skip to content

Commit 5974581

Browse files
authored
Codespell action for BotKube (#394)
This commit adds GitHub action which checks for common misspellings across repository.
1 parent b78d072 commit 5974581

File tree

11 files changed

+19
-15
lines changed

11 files changed

+19
-15
lines changed

.codespell-whitelist

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
iam
2+
ue

.github/workflows/ci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
- name: Install golint
2020
run: |
2121
go get -u golang.org/x/lint/golint
22+
- name: Codespell action
23+
uses: sanketsudake/codespell-action@v1
2224
- name: Before build
2325
run: |
2426
echo Workflow trigger - ${{ github.event_name }}

CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
- Aggregate pod status to reduce notification noise [\#212](https://github.com/infracloudio/botkube/issues/212)
1515
- Add support to monitor custom resources [\#200](https://github.com/infracloudio/botkube/issues/200)
1616
- Limit kubectl commands [\#183](https://github.com/infracloudio/botkube/issues/183)
17-
- Swich to github actions for CI builds [\#179](https://github.com/infracloudio/botkube/issues/179)
17+
- Switch to github actions for CI builds [\#179](https://github.com/infracloudio/botkube/issues/179)
1818
- Setting default namespace while executing kubectl commands [\#176](https://github.com/infracloudio/botkube/issues/176)
19-
- Add Microsoft Teams suppport [\#60](https://github.com/infracloudio/botkube/issues/60)
19+
- Add Microsoft Teams support [\#60](https://github.com/infracloudio/botkube/issues/60)
2020

2121
**Fixed bugs:**
2222

@@ -58,7 +58,7 @@
5858
- options to pass exta annotations for pod [\#304](https://github.com/infracloudio/botkube/pull/304) ([kartik-moolya](https://github.com/kartik-moolya))
5959
- Add aws config in helm values [\#303](https://github.com/infracloudio/botkube/pull/303) ([kartik-moolya](https://github.com/kartik-moolya))
6060
- adding feature to support AWS Signing and creating new index per day [\#302](https://github.com/infracloudio/botkube/pull/302) ([kartik-moolya](https://github.com/kartik-moolya))
61-
- Allow kubectl commands wihtout namespace and without cluster-name [\#301](https://github.com/infracloudio/botkube/pull/301) ([gmkumar2005](https://github.com/gmkumar2005))
61+
- Allow kubectl commands without namespace and without cluster-name [\#301](https://github.com/infracloudio/botkube/pull/301) ([gmkumar2005](https://github.com/gmkumar2005))
6262
- Mergify: configuration update [\#287](https://github.com/infracloudio/botkube/pull/287) ([PrasadG193](https://github.com/PrasadG193))
6363
- Refactor logging package \(\#262\) [\#285](https://github.com/infracloudio/botkube/pull/285) ([hmharsh](https://github.com/hmharsh))
6464
- Make allowed kubectl commands configurable [\#284](https://github.com/infracloudio/botkube/pull/284) ([girishg4t](https://github.com/girishg4t))

build/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ RUN apk add --no-cache ca-certificates git \
4646
# Production image
4747
FROM alpine:3.10
4848

49-
# Create Non Privilaged user
49+
# Create Non Privileged user
5050
RUN addgroup --gid 101 botkube && \
5151
adduser -S --uid 101 --ingroup botkube botkube
5252

53-
# Run as Non Privilaged user
53+
# Run as Non Privileged user
5454
USER botkube
5555

5656
COPY --from=BUILD-ENV /go/bin/botkube /go/bin/botkube

deploy-all-in-one-tls.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ spec:
385385
- name: certs
386386
secret:
387387
secretName: botkube-certificate-secret
388-
# run as non privilaged user
388+
# run as non privileged user
389389
securityContext:
390390
runAsUser: 101
391391
runAsGroup: 101

pkg/bot/mattermost.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (b *MMBot) Start() {
128128
return
129129
}
130130

131-
// Check incomming message and take action
131+
// Check incoming message and take action
132132
func (mm *mattermostMessage) handleMessage(b MMBot) {
133133
post := model.PostFromJson(strings.NewReader(mm.Event.Data["post"].(string)))
134134
channelType := mmChannelType(mm.Event.Data["channel_type"].(string))
@@ -163,7 +163,7 @@ func (mm mattermostMessage) sendMessage() {
163163
if len(mm.Response) >= 3990 {
164164
res, resp := mm.APIClient.UploadFileAsRequestBody([]byte(mm.Response), mm.Event.Broadcast.ChannelId, mm.Request)
165165
if resp.Error != nil {
166-
log.Error("Error occured while uploading file. Error: ", resp.Error)
166+
log.Error("Error occurred while uploading file. Error: ", resp.Error)
167167
}
168168
post.FileIds = []string{string(res.FileInfos[0].Id)}
169169
} else if len(mm.Response) == 0 {

pkg/execute/executor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ func runKubectlCommand(args []string, clusterName, defaultNamespace string, isAu
304304
return fmt.Sprintf("Cluster: %s\n%s", clusterName, out)
305305
}
306306

307-
// TODO: Have a seperate cli which runs bot commands
307+
// TODO: Have a separate cli which runs bot commands
308308
func (e *DefaultExecutor) runNotifierCommand(args []string, clusterName string, isAuthChannel bool) string {
309309
if isAuthChannel == false {
310310
return ""

pkg/filterengine/filters/object_annotation_checker_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import (
2727

2828
func TestIsObjectNotifDisabled(t *testing.T) {
2929
tests := map[string]struct {
30-
annotaion metaV1.ObjectMeta
31-
expected bool
30+
annotation metaV1.ObjectMeta
31+
expected bool
3232
}{
3333
`Empty ObjectMeta`: {metaV1.ObjectMeta{}, false},
3434
`ObjectMeta with some annotations`: {metaV1.ObjectMeta{Annotations: map[string]string{"foo": "bar"}}, false},
@@ -38,7 +38,7 @@ func TestIsObjectNotifDisabled(t *testing.T) {
3838
for name, test := range tests {
3939
name, test := name, test
4040
t.Run(name, func(t *testing.T) {
41-
if actual := isObjectNotifDisabled(test.annotaion); actual != test.expected {
41+
if actual := isObjectNotifDisabled(test.annotation); actual != test.expected {
4242
t.Errorf("expected: %+v != actual: %+v\n", test.expected, actual)
4343
}
4444
})

pkg/utils/diff_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type Object struct {
3535
Other Other `json:"other"`
3636
}
3737

38-
// Other mocks fileds like MetaData, Status etc in kubernetes objects
38+
// Other mocks fields like MetaData, Status etc in kubernetes objects
3939
type Other struct {
4040
Foo string `json:"foo"`
4141
}

pkg/utils/utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ func TransformIntoTypedObject(obj *unstructured.Unstructured, typedObject interf
361361
return runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), typedObject)
362362
}
363363

364-
//GetStringInYamlFormat get the formated commands list
364+
//GetStringInYamlFormat get the formatted commands list
365365
func GetStringInYamlFormat(header string, commands map[string]bool) string {
366366
var b bytes.Buffer
367367
fmt.Fprintln(&b, header)

test/webhook/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
4343

4444
// update message in mutex
4545
s.receivedPayloads.Lock()
46-
log.Debugf("Incomming Webhook Messages :%#v", t)
46+
log.Debugf("Incoming Webhook Messages :%#v", t)
4747
s.receivedPayloads.messages = append(s.receivedPayloads.messages, t)
4848
s.receivedPayloads.Unlock()
4949

0 commit comments

Comments
 (0)