-
Notifications
You must be signed in to change notification settings - Fork 15
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
Switch to palantir-java-format #663
Conversation
My only problem with it thus far has been,
I like the look it enforces, and it has some customizability with the Checkstyle rules. I'll try setting it up for IntelliJ in Windows based on this branch. |
9966787
to
ca5d2d8
Compare
Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. The tool reviewdog already placed comments on GitHub to indicate the places. See the tab "Files" in you PR. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues. More information on code quality in JabRef is available at https://devdocs.jabref.org/getting-into-the-code/development-strategy.html. |
Your code currently does not meet JabRef's code guidelines. We use OpenRewrite to ensure "modern" Java coding practices. The issues found can be automatically fixed. Please execute the gradle task You can check the detailed error output at the tab "Checks", section "Tests" (on the left), subsection "OpenRewrite". |
As alternative, I checked spring-java-format, but it provides bad wrapping: /**
- * Add X11 clipboard support to a text input control. It is necessary to call this method in every input where you
- * want to use it: {@code ClipBoardManager.addX11Support(TextInputControl input);}.
- *
- * @param input the TextInputControl (e.g., TextField, TextArea, and children) where adding this functionality.
- * @see <a href="https://www.uninformativ.de/blog/postings/2017-04-02/0/POSTING-en.html">Short summary for X11
- * clipboards</a>
- * @see <a href="https://unix.stackexchange.com/questions/139191/whats-the-difference-between-primary-selection-and-clipboard-buffer/139193#139193">Longer
+ * Add X11 clipboard support to a text input control. It is necessary to call this
+ * method in every input where you want to use it:
+ * {@code ClipBoardManager.addX11Support(TextInputControl input);}.
+ * @param input the TextInputControl (e.g., TextField, TextArea, and children) where
+ * adding this functionality.
+ * @see <a href=
+ * "https://www.uninformativ.de/blog/postings/2017-04-02/0/POSTING-en.html">Short
+ * summary for X11 clipboards</a>
+ * @see <a href=
+ * "https://unix.stackexchange.com/questions/139191/whats-the-difference-between-primary-selection-and-clipboard-buffer/139193#139193">Longer
* text over - public ArgumentProcessor(String[] args,
- Mode startupMode,
- PreferencesService preferencesService,
- FileUpdateMonitor fileUpdateMonitor,
- BibEntryTypesManager entryTypesManager) throws org.apache.commons.cli.ParseException {
+ public ArgumentProcessor(String[] args, Mode startupMode, PreferencesService preferencesService,
+ FileUpdateMonitor fileUpdateMonitor, BibEntryTypesManager entryTypesManager)
+ throws org.apache.commons.cli.ParseException { |
Note that spring java format uses tabs, because of good reasons:
|
prettier-java does a great job in line wrapping. palantir output: action.getKeyBinding().ifPresent(keyBinding -> keyBindingRepository
.getKeyCombination(keyBinding)
.ifPresent(combination -> setAccelerator(combination))); prettier output: action
.getKeyBinding()
.ifPresent(keyBinding ->
keyBindingRepository
.getKeyCombination(keyBinding)
.ifPresent(combination -> setAccelerator(combination))
); I like prettier more, because
I'll file another PR. Let's see, how it works out ^^ |
The prettier-java output was "random", because line wrapping was at 80 chars... If set to 100 or 120 the wrapping is worse. |
Blocked by palantir/palantir-java-format#935 |
Is it ehtically OK to use Palantir - even if it is "the best candidate"?
|
I am so fed up that
Thus, I am looking for good autoformatting tools. I thought Google's Java Code Style would be great. However, 4 spaces need extra configuration (see #661). Moreover, the project seems to be unmaintained currently. Luckily, I found a maintained alternative: palantir-java-format
The diffs look good. Only three drawbacks:
@FXML
is placed before the declaration (because all annotations are placed the line before)this(
reads strange with the 2x4 space indent next lineFor me these are no real drawbacks or show stoppers.
REgarding migration: One needs to switch away from JabRef code style to "Default". However, I think, this is manageable as the active contributors can be informed - and the "drive-by" contributors are setting up their IDE before their contribution.
(GJF was tried out at #661)
Open issues:
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)