Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 27, 2020
Merged

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

merged 1 commit into from
Dec 27, 2020

Conversation

mvdan
Copy link
Contributor

@mvdan mvdan commented Dec 18, 2020

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
Copy link
Collaborator

@warpfork warpfork left a comment

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! :)

schema/gen/go/mixins/kindTraits.go Outdated Show resolved Hide resolved
schema/gen/go/mixins/kindTraits.go Outdated Show resolved Hide resolved
schema/gen/go/templateUtil.go Outdated Show resolved Hide resolved
errors.go Outdated Show resolved Hide resolved
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
Copy link
Contributor Author

mvdan commented Dec 25, 2020

Thanks for the suggestions! All applied, I think.

@warpfork
Copy link
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