palantir / palantir/palantir-java-format

What is the easiest way to use this in Eclipse?

Open
#833 0 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
907
Forks
101
Avg merge
1d 3h
Merged PRs (30d)
19

Description

I pitched the use of palantir-java-format to my colleagues, but now I'm facing the issue of on-boarding people who use Eclipse. After exploring the available materials and issue discussions, I understand that there's no way to do it with a few clicks or by installing a plugin.

Thus, my question is: what is the path of minimum resistance for using palantir-java-format with the Eclipse IDE?.

Git hooks come to mind, one could invoke mvn spotless:apply when a commit is made. This is an IDE-agnostic approach, and I like it. However, it disregards Eclipse's formatting tools and keyboard shortcuts - which means that people won't see the auto-formatted code until they commit. Moreover, people's workflow that they developed for ages (write code, format it) will potentially be disrupted because there is no feedback loop.

Is there a way to tell Eclipse to run a given command when a file is saved? What I found so far in Project properties / Java editor / Save actions is not at all CLI-friendly, it can perform some actions from a set of possibilities that Eclipse defined, but there's no way to delegate this process to an arbitrary command.

What are the best practices when it comes to palantir-java-format and Eclipse?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file or test is named. Start with the available project materials and Eclipse's Project properties > Java editor > Save actions, then compare the mentioned git-hook and mvn spotless:apply approaches with Eclipse's save workflow. Done means documenting a practical path for Eclipse users and its trade-offs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience, tooling
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.