Skip to content

Commit 7746142

Browse files
committed
ci: add codespell job, fix existing warnings
The following warnings were fixed: ./variant.go:52: unambigously ==> unambiguously ./conn.go:172: useable ==> usable ./dbus_test.go:32: parm ==> param, pram, parma ./dbus_test.go:42: parm ==> param, pram, parma ./dbus_test.go:42: parm ==> param, pram, parma ./dbus_test.go:44: parm ==> param, pram, parma ./encoder_test.go:268: occured ==> occurred ./encoder_test.go:315: occured ==> occurred ./object_test.go:111: Catched ==> Caught ./sequential_handler_test.go:235: occured ==> occurred ./server_interfaces.go:66: incase ==> in case ./introspect/introspect.go:53: retured ==> returned Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 958b2d1 commit 7746142

File tree

9 files changed

+21
-11
lines changed

9 files changed

+21
-11
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,13 @@ jobs:
3535

3636
- name: Test
3737
run: go test ${{ matrix.race }} -v ./...
38+
39+
codespell:
40+
runs-on: ubuntu-20.04
41+
steps:
42+
- uses: actions/checkout@v2
43+
- name: install deps
44+
# Version of codespell bundled with Ubuntu is way old, so use pip.
45+
run: pip install codespell
46+
- name: run codespell
47+
run: codespell

conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func Connect(address string, opts ...ConnOption) (*Conn, error) {
169169

170170
// SystemBusPrivate returns a new private connection to the system bus.
171171
// Note: this connection is not ready to use. One must perform Auth and Hello
172-
// on the connection before it is useable.
172+
// on the connection before it is usable.
173173
func SystemBusPrivate(opts ...ConnOption) (*Conn, error) {
174174
return Dial(getSystemBusPlatformAddress(), opts...)
175175
}

dbus_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func Test_VariantOfSlicePtr(t *testing.T) {
2929
value := []TestStruct{{1, "1"}}
3030
dest := []*TestStruct{}
3131

32-
parm := &Message{
32+
param := &Message{
3333
Type: TypeMethodCall,
3434
Flags: FlagNoAutoStart,
3535
Headers: map[HeaderField]Variant{
@@ -39,9 +39,9 @@ func Test_VariantOfSlicePtr(t *testing.T) {
3939
},
4040
Body: []interface{}{value},
4141
}
42-
parm.Headers[FieldSignature] = MakeVariant(SignatureOf(parm.Body...))
42+
param.Headers[FieldSignature] = MakeVariant(SignatureOf(param.Body...))
4343
buf := new(bytes.Buffer)
44-
err := parm.EncodeTo(buf, nativeEndian)
44+
err := param.EncodeTo(buf, nativeEndian)
4545
if err != nil {
4646
t.Fatal(err)
4747
}

encoder_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func TestEncodeIntToNonCovertible(t *testing.T) {
265265
err = Store(v, &out)
266266
if err == nil {
267267
t.Logf("%t\n", out)
268-
t.Fatal("Type mismatch should have occured")
268+
t.Fatal("Type mismatch should have occurred")
269269
}
270270
}
271271

@@ -312,7 +312,7 @@ func TestEncodeUintToNonCovertible(t *testing.T) {
312312
var out bool
313313
err = Store(v, &out)
314314
if err == nil {
315-
t.Fatal("Type mismatch should have occured")
315+
t.Fatal("Type mismatch should have occurred")
316316
}
317317
}
318318

introspect/introspect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type Interface struct {
5050
Annotations []Annotation `xml:"annotation"`
5151
}
5252

53-
// Method describes a Method on an Interface as retured by an introspection.
53+
// Method describes a Method on an Interface as returned by an introspection.
5454
type Method struct {
5555
Name string `xml:"name,attr"`
5656
Args []Arg `xml:"arg"`

object_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func TestObjectSignalHandling(t *testing.T) {
108108
go func() {
109109
defer func() {
110110
if err := recover(); err != nil {
111-
t.Errorf("Catched panic in emitter goroutine: %v", err)
111+
t.Errorf("Caught panic in emitter goroutine: %v", err)
112112
}
113113
}()
114114

sequential_handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func readSignals(t *testing.T, channel <-chan *Signal, count int) error {
232232
return fmt.Errorf("Received signal out of order. Expected %v, got %v", i, signal.Sequence)
233233
}
234234
case <-ctx.Done():
235-
return errors.New("Timeout occured before all messages received")
235+
return errors.New("Timeout occurred before all messages received")
236236
}
237237
}
238238
return nil

server_interfaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ type Method interface {
6363
// any other decoding scheme.
6464
type ArgumentDecoder interface {
6565
// To decode the arguments of a method the sender and message are
66-
// provided incase the semantics of the implementer provides access
66+
// provided in case the semantics of the implementer provides access
6767
// to these as part of the method invocation.
6868
DecodeArguments(conn *Conn, sender string, msg *Message, args []interface{}) ([]interface{}, error)
6969
}

variant.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func ParseVariant(s string, sig Signature) (Variant, error) {
4949
}
5050

5151
// format returns a formatted version of v and whether this string can be parsed
52-
// unambigously.
52+
// unambiguously.
5353
func (v Variant) format() (string, bool) {
5454
switch v.sig.str[0] {
5555
case 'b', 'i':

0 commit comments

Comments
 (0)