palantir-java-format icon indicating copy to clipboard operation
palantir-java-format copied to clipboard

Add option to IDEA plugin (and CLI) to format JavaDoc #724

Open blutorange opened this issue 1 year ago • 8 comments

As discussed in #724 (as I understand it), I added an option to the IDEA plugin to enable formattting JavaDoc comments.

  • This adds an option to the IDEA plugin (checkbox) to format JavaDoc comments. It is disabled by default.
  • As the IDEA plugin (sometimes) uses the bootstrapping formatter service, which in turn uses the command line tool, this also add an option --format-javadoc to the command line tool.
  • To pass the options to the FormatterService loaded via service provider, I added a method withOptions to the service provided interface, which returns a new (immutable) instance with the updated options. Compared with the suggestion from the issue comment (https://github.com/palantir/palantir-java-format/issues/724#issuecomment-1109804294), this (a) does not require deprecating methods and (b) the options can be set independently of where the formatter is actually used.
  • Since the infrastructure to pass options to the formatter now exists, we could also add more options to the code style select configuration in the IDEA plugin, but I'm not sure if that makes sense (I want to use Palantir, after all).
  • The issue also mentioned API compatibility. The service provider interface is compatible, most other classes and methods are internal. But if somebody more familar with the code base could take another look, that would be great.
  • I also added a few tests for the new option.

Possible downsides?

  • This adds an option that affects the formatter output, and Palantir strives to be an opinionated formatter without any configuration. As discussed in the issue, though, adding an option for fomatting JavaDoc should be ok.

image

blutorange avatar Jan 21 '24 15:01 blutorange

Thanks for your interest in palantir/palantir-java-format, @blutorange! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

palantirtech avatar Jan 21 '24 15:01 palantirtech

Generate changelog in changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration, performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • [x] Feature
  • [ ] Improvement
  • [ ] Fix
  • [ ] Break
  • [ ] Deprecation
  • [ ] Manual task
  • [ ] Migration

Description Add option to IDEA plugin (and CLI) to format JavaDoc #724

Check the box to generate changelog(s)

  • [x] Generate changelog entry

changelog-app[bot] avatar Jan 21 '24 15:01 changelog-app[bot]

@schlosna As far as I can see, the changelog needs to be generated by somebody with the proper permissions for this repo?

blutorange avatar Jan 30 '24 09:01 blutorange

Is there anything I still need to do before this PR can be considered for review?

blutorange avatar Mar 15 '24 13:03 blutorange

This branch has conflicts that must be resolved.

walles avatar Apr 27 '24 06:04 walles

Thanks for notifying me! I resolved the conflicts in case anybody wants to take a look at getting this merged.

blutorange avatar Apr 29 '24 06:04 blutorange

Is there any chance of getting this merged? Are you open to adding this option to the plugin or should I close this?

blutorange avatar Aug 08 '24 07:08 blutorange