-
Notifications
You must be signed in to change notification settings - Fork 127
docs: snow package #2035
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
base: main
Are you sure you want to change the base?
docs: snow package #2035
Conversation
// alternative block handler functions that provide the snowman.Block type to the | ||
// consensus engine. | ||
// | ||
//nolint:revive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this directive we're getting:
snow/snow_vm.go:23:6: exported: type name will be used as snow.SnowVM by other packages, and that is repetitive; consider calling this VM (revive)
type SnowVM[I Block, O Block, A Block] struct {
^
1 issues:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one comment seems to be incorrect. the rest are good.
snow/vm.go
Outdated
func (v *VM[I, O, A]) GetNetwork() *p2p.Network { | ||
return v.network | ||
} | ||
|
||
// AddAcceptedSub adds subscriotions tracking accepted blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// AddAcceptedSub adds subscriotions tracking accepted blocks | |
// AddAcceptedSub adds subscriptions that track accepted blocks |
func (v *VM[I, O, A]) GetInputCovariantVM() *InputCovariantVM[I, O, A] { | ||
return &InputCovariantVM[I, O, A]{vm: v} | ||
} | ||
|
||
// GetNetwork returns *p2p.Network |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we change this? Saying that GetNetwork()
returns *p2p.Network
is repetitive (we already know this from the function signature).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment for GetInputCovariantVM()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you change it? I tried to override revivew lint rule to omit functions starting with Get and Set but couldn't find a way without forking it.
I'm using Grazie Pro plugin to help me with spelling and grammar. Grazie Pro reports the same for each proposed update in comments on the PR. ![]() English is not my native language. Personally I think it's unnecessary and plugin seems to agree but if you really think it should be added than I will update documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the changes
Closes: #2011
Having
doc.go
file to describe the whole package lacks examples and context instead I have decided to add documentation to each exported function which is already enforced by the revive lint rule.Test
Run
godoc -http 8080
and navigate to http://localhost:8080/pkg/github.com/ava-labs/hypersdk/snow/