Skip to content

Add a few cleanup formatters#853

Merged
simonharrer merged 3 commits into
JabRef:masterfrom
tobiasdiez:addCleanup
Feb 22, 2016
Merged

Add a few cleanup formatters#853
simonharrer merged 3 commits into
JabRef:masterfrom
tobiasdiez:addCleanup

Conversation

@tobiasdiez

Copy link
Copy Markdown
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 [outdated] 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.
@@ -24,11 +24,6 @@ public void testBasic() {
assertEquals("aaa", conv.formatUnicode("aaa"));
}

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@stefan-kolb

Copy link
Copy Markdown
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

[outdated] type: feature status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants