Skip to content
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

Add a few cleanup formatters #853

Merged
merged 3 commits into from
Feb 22, 2016
Merged

Conversation

tobiasdiez
Copy link
Member

This PR adds the following formatters, which are suitable for the new save actions functionality #821:

  • TrimFormatter: trims whitespace (as suggested in Save actions gui #821 (comment))
  • RemoveBracesFormatter: removes enclosing braces (i.e. "{{test}}" -> "test"). Partly implements kooper #60. This functionality was previously available under the option "Remove double braces around BibTeX fields when
    loading" but was removed from the parser in c2928d2.

Also add some tests for all formatters.

@tobiasdiez tobiasdiez added type: feature status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Feb 21, 2016
Readd functionality "Remove double braces around BibTeX fields when
loading" (which was removed in c2928d2)
as a formatter.
@@ -25,11 +25,6 @@ public void testBasic() {
}

@Test
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep and add (expected...)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, now I saw the next file... ;-)

@oscargus
Copy link
Contributor

👍

Now I only want a formatter that removes ' around fields. A colleague does that as that also keeps the casing... However, I guess it may be a rare use case for the general public...

@simonharrer
Copy link
Contributor

👍 nice. I especially like the data driven test of all formatters! Good idea.

@stefan-kolb
Copy link
Member

LGTM 👍

simonharrer added a commit that referenced this pull request Feb 22, 2016
@simonharrer simonharrer merged commit c57e8ac into JabRef:master Feb 22, 2016
@tobiasdiez tobiasdiez deleted the addCleanup branch February 22, 2016 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers type: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants