-
Notifications
You must be signed in to change notification settings - Fork 683
Fix FILE_PATTERNS of Doxyfile and some of the issues it was hiding #2446
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
Note: Doxygen has not been processing headers since #1540 . Note 2: The list of files with still missing documentation (i.e., not fixed by this PR) is:
I'm happy to break them out into an issue to track the progress of their fixes, should the PR be accepted and the issue considered valid. (But I cannot volunteer to document them.) |
jerry-core/ecma/base/ecma-globals.h
Outdated
* Description of pseudo array objects. | ||
*/ | ||
struct | ||
{ | ||
uint8_t type; /**< pseudo array type, e.g. Arguments, TypedArray*/ | ||
uint8_t extra_info; /**< extra infomations about the object. | ||
* e.g. element_width_shift for typed arrays */ | ||
uint8_t extra_info; /**< extra infomation about the object. |
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.
infromation
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.
information
* Minimum positive and maximum value of ecma-number | ||
* Number.MIN_VALUE (i.e., the smallest positive value of ecma-number) | ||
* | ||
* See also: ECMA_262 v5, 15.7.3.3 |
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 really like these comment duplications. Is there a better way to do this?
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 are no easy ways and/or this is the way that's compatible with the rest of ecma-globals.h. (E.g., see the documentation of ecma_number_t
, ECMA_NUMBER_MAX_DIGITS
, ECMA_NUMBER_SIGN_WIDTH
, ECMA_NUMBER_BIASED_EXP_WIDTH
, and ECMA_NUMBER_FRACTION_WIDTH
.) I've followed that approach here, too.
FYI, there may be one way to reduce duplication by using @def MACRONAME(args)
doxygen syntax to break out documentation from before the macro definitions, but that might necessitate a bigger rewrite throughout the code base (to apply that approach everywhere where macros (or typedefs, or functions) are conditionally defined multiple times). Moreover, that approach should be discussed further as it splits the documentation from the documented entity, making maintenance somewhat harder. So, I'd have that separate from this PR.
(To restate: this PR tries to fix the problem in the Doxyfile with the least friction, fixing only the fallout that can be easily fixed, leaving the rest for follow-up.)
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.
You can use @copydoc
or groups to avoid duplication in comments. Maybe my previous PR can help: #2324
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.
But you cannot copy documentation when an entity is defined multiple times because of conditional compilation, can you? I guess you cannot copydoc self.
#if COND
/** documentation of X */
#define X
/** documentation of Y */
#define Y
#else
/** @copydoc X */ // <-- THIS SHOULDN'T WORK
#define X
/** @copydoc Y */ // <-- THIS SHOULDN'T WORK
#define Y
#endif
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.
IHMO the default macro conditions should be documented. The Doxygen docs will be generated with the default config. BTW you can use a group comment before the #if
which should work independently from the configuration. Although this can be useful in simple cases only (like your example in the prev. comment).
@@ -73,61 +73,111 @@ void * __cdecl _alloca (size_t _Size); | |||
/* | |||
* Attributes | |||
*/ | |||
|
|||
/** | |||
* Function attribute to direct compiler to align function to given number of |
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 would remove these "to direct compiler" parts.
@@ -57,21 +57,21 @@ typedef enum | |||
|
|||
/* Flags for status_flags. */ | |||
|
|||
/* Local identifier (var, function arg). */ | |||
/** Local identifier (var, function arg). */ |
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.
Hm, would be better to convert these into an enum.
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 won't be pursuing that in this PR, which is solely about documentation fixes.
jerry-core/parser/js/js-parser.h
Outdated
@@ -122,7 +122,7 @@ typedef enum | |||
PARSER_ERR_NON_STRICT_ARG_DEFINITION /**< non-strict argument definition */ | |||
} parser_error_t; | |||
|
|||
/* Source code line counter type. */ | |||
/** Source code line counter type. */ |
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 should use the multiline form here.
c819d28
to
1f08cd4
Compare
PR updated, actioned most of the review comments |
1f08cd4
to
4f14877
Compare
PR rebased to latest master |
/** | ||
* Function attribute to trigger warning if function's caller doesn't use (e.g., | ||
* check) the return value. | ||
*/ | ||
#ifndef JERRY_ATTR_WARN_UNUSED_RESULT | ||
#define JERRY_ATTR_WARN_UNUSED_RESULT | ||
#endif /* !JERRY_ATTR_WARN_UNUSED_RESULT */ | ||
|
||
/* | ||
* Condition likeliness, unlikeliness | ||
*/ |
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.
Shall we keep this comment? It seems unnecessary 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.
It is/was only a grouping comment by I can remove it. But then I'll remove the other grouping comment ("Attributes"), too.
jerry-core/ecma/base/ecma-globals.h
Outdated
@@ -142,7 +142,7 @@ typedef int32_t ecma_integer_value_t; | |||
*/ | |||
#define ECMA_DIRECT_SHIFT 4 | |||
|
|||
/* ECMA make simple value */ | |||
/** ECMA make simple value */ |
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 would turn this a 3 line form.
`FILE_PATTERNS` is a space-separated list, in contrary to what is suggested by its documentation. The pattern `*.h, *.c` does not match header files but files with `.h,` extension only. Rewriting the current comma-separated pattern makes Doxygen actually process header files. However, it also reveals several hitherto hidden issues (mostly missing documentation) in the code. This patch fixes some of these documentation problems (and lists the files with outstanding issues in a 'backlog'). JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]
4f14877
to
236d37c
Compare
PR updated |
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.
LGTM
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.
LGTM
FILE_PATTERNS
is a space-separated list, in contrary to what issuggested by its documentation. The pattern
*.h, *.c
does notmatch header files but files with
.h,
extension only. Rewritingthe current comma-separated pattern makes Doxygen actually process
header files. However, it also reveals several hitherto hidden
issues (mostly missing documentation) in the code. This patch fixes
some of these documentation problems (and lists the files with
outstanding issues in a 'backlog').
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]