Skip to content

Allow javadoc formatting to be skipped. #139

Description

@sdavids

This is useful if one uses the AsciiDoc syntax to write one's Javadoc.

https://github.com/asciidoctor/asciidoclet/

Activity

  1. kevinb9n commented on Mar 17, 2017

    @kevinb9n
    Contributor

    We could consider skipping it whenever the first character of doc is =...

  2. sdavids commented on Mar 17, 2017

    @sdavids
    Author

    What about field/method comments?

    example: Awesome Asciidoctor: Using Asciidoctor In Javadoc Comments

  3. kevinb9n commented on Mar 17, 2017

    @kevinb9n
    Contributor

    Same deal -- if you make it recognizable to the tool then we can consider recognizing it. I don't know why the example you linked makes it clear for the class (starting = sign) but not for the method; that seems like a mistake.

  4. sdavids commented on Mar 17, 2017

    @sdavids
    Author

    = is equivalent to <h1>

    Section Titles (Headings)

    /** = the example */
    private String example;
    

    is equivalent to:

    /** <h1> the example */
    private String example;
    

    What I meant:

    = is not used to flag 'this is asciidoc' rather than normal javadoc

  5. kevinb9n commented on Mar 17, 2017

    @kevinb9n
    Contributor

    Oh. That's too bad. If they're going to diverge from the 20-year standard of what javadoc looks like, they should at least make that divergence detectable. For one thing, they leave a large codebase, where people actually care about and write documentation, out of luck for how it might transition. (Perhaps they figure such codebases don't exist, but... they do!)

    What are other arguments for making javadoc formatting optional in google-java-format?

  6. sdavids commented on Mar 17, 2017

    @sdavids
    Author

    As far as I know, the Doclet API does not prescribe the markup of the comment (the StandardDoclet does though.)

    Here are two doclets supporting Markdown markup:

    https://github.com/Abnaxos/pegdown-doclet
    http://doclet.github.io

    In both pegdown-doclet and asciidoclet one can even embed PlantUML syntax to generate diagrams (see the example in Awesome Asciidoctor: Using Asciidoctor In Javadoc Comments).

  7. sdavids commented on Mar 17, 2017

    @sdavids
    Author

    Yes, we have a 20-year standard and yes it is used in most projects.

    But if one starts a new project now, one might consider using a more pleasant markup language than HTML.

    Also, IntelliJ, Eclipse, Netbeans, and Jindent can be configured to ignore JavaDoc formatting.

  8. hdezninirola commented on Mar 30, 2017

    @hdezninirola

    Why not just have an option to exclude formatting javadoc?

  9. pettermahlen commented on Dec 8, 2017

    @pettermahlen

    There is also a convention to use /*- to indicate that a block comment should not be formatted: http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-141999.html#350.

    This would be useful to avoid formatting license headers - the various license plugins that exist for maven, gradle, etc., tend to use exact string matches and therefore conflict with google-java-format.

  10. kevinb9n commented on Dec 8, 2017

    @kevinb9n
    Contributor

    (Off-topic to current issue, since Javadoc has to begin with /**.)

  11. kevinb9n commented on Dec 8, 2017

    @kevinb9n
    Contributor

    Back to the main topic, I would support this as a command-line option. We push back on options that we see as configuring its formatting choices, but we do have several that merely switch on or off certain of its functions.

  12. added a commit that references this issue on Nov 12, 2019
    8df44e5
  13. added a commit that references this issue on Nov 12, 2019
    bd17670
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions