Skip to content

Commit

Permalink
Fix typos found by codespell (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos authored Sep 3, 2024
1 parent cb3864e commit 41fd08e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion element.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (e *Element) String() string {

// Value represents a DICOM value. The underlying data that a Value stores can be determined by inspecting its
// ValueType. DICOM values typically can be one of many types (ints, strings, bytes, sequences of other elements, etc),
// so this Value interface attempts to represent this as canoically as possible in Golang (since generics do not exist
// so this Value interface attempts to represent this as canonically as possible in Golang (since generics do not exist
// yet).
//
// Value is JSON serializable out of the box (implements json.Marshaler).
Expand Down
2 changes: 1 addition & 1 deletion pkg/frame/native.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
var ErrUnsupportedSamplesPerPixel = errors.New("unsupported samples per pixel")

// INativeFrame is an interface representation of NativeFrame[I]'s capabilities,
// and offers a way to use a NativeFrame _without_ requiring propogation of
// and offers a way to use a NativeFrame _without_ requiring propagation of
// type parameters. This allows for some more ergonomic signatures, though
// NativeFrame[I] can be used directly as well for those who prefer it.
type INativeFrame interface {
Expand Down
4 changes: 2 additions & 2 deletions pkg/personname/groupInfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func TestNewPersonNameFromDicom(t *testing.T) {

if tc.IsEmpty != parsed.IsEmpty() {
t.Errorf(
".IsEmpty() returned %v, extected %v",
".IsEmpty() returned %v, expected %v",
parsed.IsEmpty(),
tc.IsEmpty,
)
Expand All @@ -387,7 +387,7 @@ func TestGroupInfo_DCM_interiorNullsExceedTrailingLevel(t *testing.T) {
}

if dcm != "CROUCH^^^^JR" {
t.Errorf("dcm returned uneexpected value: %v", dcm)
t.Errorf("dcm returned unexpected value: %v", dcm)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/uid/uid.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func CanonicalTransferSyntaxUID(uid string) (string, error) {
}

// ParseTransferSyntaxUID parses a transfer syntax uid and returns its byteorder
// and implicitVR/explicitVR type. TrasnferSyntaxUID can be any UID that refers to
// and implicitVR/explicitVR type. TransferSyntaxUID can be any UID that refers to
// a transfer syntax. It can be, e.g., 1.2.840.10008.1.2 (it will return
// LittleEndian, ImplicitVR) or 1.2.840.10008.1.2.4.54 (it will return
// (LittleEndian, ExplicitVR).
Expand Down
6 changes: 3 additions & 3 deletions read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ func TestReadHeader_TryAllowErrorMetaElementGroupLength(t *testing.T) {
t.Run("NoFileMetaInformationGroupLength", func(t *testing.T) {
dcmheaderNoInfoGrpLen, err := headerWithNoFileMetaInformationGroupLength()
if err != nil {
t.Fatalf("unsuccesful generation of fake header data")
t.Fatalf("unsuccessful generation of fake header data")
} else {
r := &reader{
rawReader: dicomio.NewReader(bufio.NewReader(dcmheaderNoInfoGrpLen.HeaderBytes), binary.LittleEndian, int64(dcmheaderNoInfoGrpLen.HeaderBytes.Len())),
Expand All @@ -772,7 +772,7 @@ func TestReadHeader_TryAllowErrorMetaElementGroupLength(t *testing.T) {
t.Run("WithFileMetaInformationGroupLength", func(t *testing.T) {
dcmHeaderInfoGrpLen, err := headerWithFileMetaInformationGroupLength()
if err != nil {
t.Fatalf("unsuccesful generation of fake header data with FileMetaInformationGroupLength")
t.Fatalf("unsuccessful generation of fake header data with FileMetaInformationGroupLength")
} else {
r := &reader{
rawReader: dicomio.NewReader(bufio.NewReader(dcmHeaderInfoGrpLen.HeaderBytes), binary.LittleEndian, int64(dcmHeaderInfoGrpLen.HeaderBytes.Len())),
Expand All @@ -781,7 +781,7 @@ func TestReadHeader_TryAllowErrorMetaElementGroupLength(t *testing.T) {
r.rawReader.SetTransferSyntax(binary.LittleEndian, true)
wantElements, err := r.readHeader()
if err != nil {
t.Errorf("unsuccesful readHeader when parse option %v is turned on and header has no MetaElementGroupLength tag", opts.allowMissingMetaElementGroupLength)
t.Errorf("unsuccessful readHeader when parse option %v is turned on and header has no MetaElementGroupLength tag", opts.allowMissingMetaElementGroupLength)
}
// Ensure dataset read from readHeader and the test header are the same except for the ValueLength field.
if diff := cmp.Diff(wantElements, dcmHeaderInfoGrpLen.Elements, cmp.AllowUnexported(allValues...), cmpopts.IgnoreFields(Element{}, "ValueLength")); diff != "" {
Expand Down
2 changes: 1 addition & 1 deletion write.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func verifyVROrDefault(t tag.Tag, vr string, opts writeOptSet) (string, error) {

// Verify the VR on the way out if the caller wants it.
if !opts.skipVRVerification && !slices.Contains(tagInfo.VRs, vr) {
return "", fmt.Errorf("ERROR dicomio.veryifyElement: VR mismatch for tag %v. Element.VR=%v, but DICOM standard defines VR to be %v",
return "", fmt.Errorf("ERROR dicomio.verifyElement: VR mismatch for tag %v. Element.VR=%v, but DICOM standard defines VR to be %v",
tag.DebugString(t), vr, tagInfo.VRs)
}

Expand Down

0 comments on commit 41fd08e

Please sign in to comment.