Skip to content

Conversation

@EricW123
Copy link

Refactor Formatter and FieldFormatterCleanups in package org.jabref.logic.cleanup.

  • Move Formatter to logic.formatter package, as base class of other formatters.
  • Rename FieldFormatterCleanups to FieldFormatterCleanupActions.
  • Abstract parsing logic to a new class named FieldFormatterCleanupParser.

Closes #14280

Steps to test

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (if change is visible to the user)
  • [/] I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

Refactor Formatter and FieldFormatterCleanups in package
org.jabref.logic.cleanup.

- Move Formatter to logic.formatter package, as base class of
  other formatters.
- Rename FieldFormatterCleanups to FieldFormatterCleanupActions.
- Abstract parsing logic to a new class named
  FieldFormatterCleanupParser.
@jabref-machine
Copy link
Collaborator

Your code currently does not meet JabRef's code guidelines. IntelliJ auto format covers some cases. There seem to be issues with your code style and autoformat configuration. Please reformat your code (Ctrl+Alt+L) and commit, then push.

In special cases, consider using // formatter:off and // formatter:on annotations to allow deviation from the code style.

@Siedlerchr Siedlerchr changed the title Refactor formatter cleanup classes (Issue #14280) Refactor formatter cleanup classes Nov 11, 2025
@koppor
Copy link
Member

koppor commented Nov 11, 2025

@EricW123 Thank you for your contribution. Please fix the the issues discovered by the CI so that the code is proapred for human review.

@koppor koppor added the status: changes-required Pull requests that are not yet complete label Nov 11, 2025
Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EricW123 Thank you for bringing this up. Since this PR tackles two problems, it gets hard to review. I split out the Formatter refactoring at #14385. - For the other thing, more work might be needed.

}

public static List<FieldFormatterCleanup> parse(String formatterString) {
if ((formatterString == null) || formatterString.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method is now a one-liner - maybe remove competely (if I read your issue correctly)

…-14280

# Conflicts:
#	jabgui/src/main/java/org/jabref/gui/cleanup/CleanupPresetPanel.java
#	jabgui/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Nov 23, 2025
@calixtus
Copy link
Member

@EricW123 I took the liberty to merge upstream and to fix merge conflicts. Should be easier to for you, if you want to pick this PR up again.

@jabref-machine
Copy link
Collaborator

JUnit tests of jablib are failing. You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. To see the test output, locate "Source Code Tests / Unit tests (pull_request)" and click on it.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

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.

Refactor Formatter and FieldFormatterCleanups for clearer structure and simpler class responsibilities

4 participants