Skip to content

Conversation

rogpeppe
Copy link
Contributor

This PR adds comprehensive doc comments to all exported
constants, mostly derived from the Apple documentation
but with changes to make them directly relevant to this package's API.

It also uses C constants directly rather than relying on an implicit
association between 1<<iota and the actual enum values.

It also unexports GetStreamRefPaths, GetStreamRefDescription
and GetStreamRefDeviceID because none of them are usable
with this package's API because there is no way to get an
FSEventStreamRef value because it's hidden inside an unexported
field inside the EventStream struct.

Also unexport the CFRunLoopRef because it's similarly
not useful or usable.

Other than the above unexports, the API remains identical.

Unfortunately I am unable to get the tests to pass, which
makes me think that something is wrong somewhere, but
that applies to the original code too, not just the code with
these changes applied.

What does this pull request do?

Where should the reviewer start?

How should this be manually tested?

This PR adds comprehensive doc comments to all exported
constants, mostly derived from the Apple documentation
but with changes to make them directly relevant to this package's API.

It also uses C constants directly rather than relying on an implicit
association between `1<<iota` and the actual enum values.

It also unexports `GetStreamRefPaths`, `GetStreamRefDescription`
and `GetStreamRefDeviceID`  because none of them are usable
with this package's API because there is no way to get an
`FSEventStreamRef` value because it's hidden inside an unexported
field inside the `EventStream` struct.

Also unexport the `CFRunLoopRef` because it's similarly
not useful or usable.

Other than the above unexports, the API remains identical.

Unfortunately I am unable to get the tests to pass, which
makes me think that something is wrong somewhere, but
that applies to the original code too, not just the code with
these changes applied.
Copy link
Contributor

@nathany nathany left a comment

Choose a reason for hiding this comment

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

This PR adds comprehensive doc comments to all exported
constants, mostly derived from the Apple documentation

That may be a violation of Apple's copyright? 🤔

TBH, this seems like it could be too much documentation. I'd rather keep the documentation light -- somewhere in between what it was and what you propose -- and then refer to Apple's docs for more depth.

// only provide information to help you diagnose the problem.
KernelDropped = EventFlags(C.kFSEventStreamEventFlagKernelDropped)

// UserDropped is related to UserDropped above.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// UserDropped is related to UserDropped above.
// UserDropped is related to KernelDropped above.

@arp242 arp242 merged commit 0bd000f into fsnotify:main Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants