-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix docurium missing includes #4530
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
Conversation
I've pushed my work-in-progress to my own gh-pages branch so it's available here. Note that it requires tweaks to docurium which aren't upstream (yet, there's some in a PR, but now there's more 😉). Highlights :
|
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.
Really, thanks a lot for working on this! Documentation is always a very important piece of the puzzle that most developers (including myself) hate working on. Some comments below.
* are multiple rules for a given file. The highest priority rule will be | ||
* used. | ||
* | ||
* @see git_attr_foreach. |
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.
I don't think there should be a trailing dot here?
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.
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.
We do have some special syntax for referring to other functions, I just always forget about it... and right now I cannot find any examples for it, either. Maybe prefixing it with an @
? No idea...
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.
I haven't been able to pinpoint a specific syntax in the docurium code, or any specific behavior w.r.t javadoc comments for that matter. As far as I can see, it checks function arguments against the list of known types and build links that way, but it only does this on functions. I've tried extending it to struct fields to no avail.
include/git2/worktree.h
Outdated
/** | ||
* Worktree add options structure | ||
* | ||
* Zero out for defaults. Initialize with `GIT_WORKTREE_ADD_OPTIONS_INIT` |
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.
We shouldn't recommend zeroing out the struct, but only using GIT_WORKTREE_ADD_OPTIONS_INIT
or the corresponding function, I guess.
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.
IIRC this is copy-pasted from git_checkout_options
. So what about something like :
/**
* $STRUCT_DESCRIPTION
*
* Initialize with `$STRUCT_INIT_MACRO`. Alternatively, you can
* use `$STRUCT_INIT_FN`.
*
* @see $STRUCT_USERS
*/
and I take a look to make sure all conform to this style ?
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.
I expected that this was copied from somewhere else, but was too lazy to double-check :P Your proposal would certainly be fine with me, and removing references to zeroing out the structure are definitly welcome.
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.
Agreed with @pks-t, and I like this text you've provided.
include/git2/worktree.h
Outdated
/** | ||
* Worktree prune options structure | ||
* | ||
* Zero out for defaults. Initialize with `GIT_WORKTREE_PRUNE_OPTIONS_INIT` |
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 here wrt zeroing out the struct.
include/git2/worktree.h
Outdated
@@ -180,7 +180,7 @@ typedef enum { | |||
typedef struct git_worktree_prune_options { | |||
unsigned int version; | |||
|
|||
uint32_t flags; | |||
git_worktree_prune_t flags; |
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.
This is not correct, though. An enum should always have a valid enum value, only, and not be used as a field of bits. As we're ORing multiple flags into this field this has to bee an uint32.
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.
Right, I missed the ORing 🙄. Will drop from patchset. I was trying to get nice a link to show up, so I'll make it a doc-comment instead.
df10416
to
c520b52
Compare
Rebased, removed the worktree change, mass-rewritten the This fixes #4495, #4213, makes most of the stuff in Some examples :
See my doc branch here. Some things I don't quite like : I get many errors when docuriuming old tagged releases, and I don't think they can be fixed, or even if it's worth the pain of doing workarounds. As far as I can tell, there are no severe losses in documentation vs. the vanilla docurium. |
e94310e
to
90be04e
Compare
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.
Looks all good to me, I noticed one minor typo though. @carlosmn, as you're the one handling doc generation most of the time: do you have any comments?
@@ -8,6 +8,7 @@ | |||
#define INCLUDE_git_transaction_h__ | |||
|
|||
#include "common.h" | |||
#include "types.h" |
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.
Hum. Good enough for now, I'd say. I feel like we should just include "types.h" in "common.h", as nearly every header wants "types.h" to be included. Can be done in a separate PR, though
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.
👍 on that. I fear the next time an header is added, it will be forgotten and the clang-parse phase of docurium will get incomplete results.
include/git2/attr.h
Outdated
* @see git_attr_foreach. | ||
* | ||
* @param name The attribute name. | ||
* @param value The attribute value. May be NULL is the attribute is explicitly |
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.
Typo: "s/is/if"
90be04e
to
73ce3ea
Compare
include/git2/blame.h
Outdated
size_t min_line; | ||
/** The last line in the file to blame. | ||
* The default is the last line of the file. |
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.
Quick drive-by comment as I accidentally stumbled over these lines: the style should rather be
/**
* Foobar
*/
@@ -70,6 +69,16 @@ typedef struct git_describe_options { | |||
GIT_DESCRIBE_DEFAULT_MAX_CANDIDATES_TAGS, \ | |||
} | |||
|
|||
/** | |||
* Initialize git_describe_options structure |
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.
This one and git_describe_init_format_options
both miss the leading short doc string that you're consistently using for the other init_options functions now
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.
Fixed-up !
Otherwise docurium/clang chokes on the types, and ignores the documentation comments altogether.
Most files under `git2/sys` have their includes prefixed with `git2`. Since Docurium exports its input headers in a temporary directory without the `git2` prefix, all those headers fail to parse.
8896716
to
04c48af
Compare
Thanks @tiennou for handling this! |
The first commit makes
git_oid
&git_buf
"globally" visible (ie. less likely to be forgotten) by including them fromtypes.h
. If that's not really appropriate, it could be fixed more precisely by going through each error from this script.Apart from a typechange (see
worktree:
commit), the rest is minor fixups + missing documentation.Fixes #4213, #4495, maybe #4492.