Skip to content

all: rename schema.Kind to TypeKind, ipld.ReprKind to Kind#127

Merged
warpfork merged 1 commit into
ipld:masterfrom
mvdan:kind-renames
Dec 27, 2020
Merged

all: rename schema.Kind to TypeKind, ipld.ReprKind to Kind#127
warpfork merged 1 commit into
ipld:masterfrom
mvdan:kind-renames

Conversation

@mvdan

@mvdan mvdan commented Dec 18, 2020

Copy link
Copy Markdown
Contributor

As discussed on the issue thread, ipld.Kind and schema.TypeKind are more
intuitive, closer to the spec wording, and just generally better in the
long run.

The changes are almost entirely automated via the commands below. Very
minor changes were needed in some of the generators, and then gofmt.

sed -ri 's/\<Kind\(\)/TypeKind()/g' **/*.go
git checkout fluent # since it uses reflect.Value.Kind

sed -ri 's/\<Kind_/TypeKind_/g' **/*.go
sed -i 's/\<Kind\>/TypeKind/g' **/*.go
sed -i 's/ReprKind/Kind/g' **/*.go

Fixes #94.

@mvdan mvdan requested a review from warpfork December 18, 2020 21:10

@warpfork warpfork left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so happy about this. This rename is long due, and the new code reads much better all over the place. Thank you for grinding this through!

I found a couple spots where things got renamed to TypeKind where they should still be just Kind in the new nomenclature. Everything is logically correct of course, but the names are off. I hope it's not too much work to flip those back. And after that I'll be really excited to merge this! :)

Comment thread schema/gen/go/mixins/kindTraits.go Outdated
Comment thread schema/gen/go/mixins/kindTraits.go Outdated
Comment thread schema/gen/go/templateUtil.go Outdated
Comment thread errors.go Outdated
As discussed on the issue thread, ipld.Kind and schema.TypeKind are more
intuitive, closer to the spec wording, and just generally better in the
long run.

The changes are almost entirely automated via the commands below. Very
minor changes were needed in some of the generators, and then gofmt.

	sed -ri 's/\<Kind\(\)/TypeKind()/g' **/*.go
	git checkout fluent # since it uses reflect.Value.Kind

	sed -ri 's/\<Kind_/TypeKind_/g' **/*.go
	sed -i 's/\<Kind\>/TypeKind/g' **/*.go
	sed -i 's/ReprKind/Kind/g' **/*.go

Plus manually undoing a few renames, as per Eric's review.

Fixes #94.
@mvdan

mvdan commented Dec 25, 2020

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestions! All applied, I think.

@warpfork

Copy link
Copy Markdown
Collaborator

Big hoorays! 🎊

@warpfork warpfork merged commit 4dc6893 into ipld:master Dec 27, 2020
@mvdan mvdan deleted the kind-renames branch January 4, 2021 11:05
@aschmahmann aschmahmann mentioned this pull request May 14, 2021
71 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rename ReprKind to just Kind

2 participants