Skip to content

Consistent documentation comments #746

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

Merged
merged 1 commit into from
May 24, 2022
Merged

Conversation

akinomyoga
Copy link
Collaborator

The documentation comments (doc comments) of some functions are not consistent with others. This PR fixes it.

Discussion

Maybe we can also discuss the syntax of doc comments used in bash-completion here. #736 (comment) is a related comment.

  • What is the set of directives of the form @xxxxx used in bash-completion?
    • Currently, @param, @see, @deprecated, @return are used in the codebase.
    • Is the current syntax in bash-completion doc comments defined by Javadoc?
    • Is there already any tool to process these doc comments? If not, maybe we can introduce one or may create a simple script to extract these comments.
  • Can we introduce @var that is used to mark the variable name referenced or modified by the function?
  • @usage might also be useful. Currently, usages are written as Usage: .... in the comment, e.g.,
    # Usage: local "$1" && _upvar $1 "value(s)"

    # Usage: local varname [varname ...] &&
    # _upvars [-v varname value] | [-aN varname [value ...]] ...
  • @option might also be useful.

@scop scop merged commit e7af108 into scop:master May 24, 2022
@scop
Copy link
Owner

scop commented May 24, 2022

I'm not aware of a processor nor a specific set of keywords to use with the @ prefixed markers. They were introduced by someone else a long time ago. They do look a lot like Java/PHP comments.

To me, the most important thing regarding these comment blocks would be to show a "quick help" in editors/IDE's with the info from the comments when hovering over a function, either just as-is, or if there's some structure supported, even better. Personally for shell code I'm using mostly Emacs, and JetBrains IDEs every now and then, and ad hoc vim edits at times, but I'm not aware of a comment/doc format for shell code that would work with any of these (haven't even really looked TBH though). In addition to that, I wouldn't mind a processor that can be run separately to produce e.g. HTML docs, but quite frankly that's not at all that interesting to me.

@akinomyoga
Copy link
Collaborator Author

I'm not aware of a processor nor a specific set of keywords to use with the @ prefixed markers. They were introduced by someone else a long time ago. They do look a lot like Java/PHP comments.

I see, thanks for the information!

@akinomyoga akinomyoga deleted the refactor-doc-comment branch May 24, 2022 21:43
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.

2 participants