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

Implementation of new modifiers for issue #11367 #12067

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

Mtjpp
Copy link

@Mtjpp Mtjpp commented Oct 23, 2024

Describe the changes you have made here:

Implementation for issue: #11367

I have implemented new modifiers that can be used when renaming a PDF file used in file name format based on this comment: #11367 (comment) .

List of implemented modifiers:
Camel
CamelN
VeryShortTitle
ShortTitle

User documentation needs to be updated:
https://docs.jabref.org/setup/citationkeypatterns#modifiers

Mandatory checks

  • I own the copyright of the code submitted and I licence it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked 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 to the documentation repository.

Mtjpp and others added 6 commits October 23, 2024 19:03
CamelN
Camel
ShortTitleFormatter
VeryShortTitleFormatter
CamelN
Camel
ShortTitleFormatter
VeryShortTitleFormatter
# Conflicts:
#	src/main/java/org/jabref/logic/formatter/casechanger/CamelFormatter.java
#	src/main/java/org/jabref/logic/formatter/casechanger/CamelNFormatter.java
#	src/main/java/org/jabref/logic/formatter/casechanger/ShortTitleFormatter.java
#	src/main/java/org/jabref/logic/formatter/casechanger/VeryShortTitleFormatter.java
# Conflicts:
#	src/main/java/org/jabref/logic/formatter/casechanger/CamelFormatter.java
#	src/main/java/org/jabref/logic/formatter/casechanger/CamelNFormatter.java
#	src/main/java/org/jabref/logic/formatter/casechanger/ShortTitleFormatter.java
#	src/main/java/org/jabref/logic/formatter/casechanger/VeryShortTitleFormatter.java
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.

First impression: Looks good.

There should be tests for the use of veryhorttitle etc. I think, you will find the existing tests and then you can refine them.

Mtjpp and others added 2 commits October 25, 2024 20:49
# Conflicts:
#	src/main/java/org/jabref/logic/formatter/casechanger/CamelFormatter.java
#	src/main/java/org/jabref/logic/formatter/casechanger/CamelNFormatter.java
#	src/main/java/org/jabref/logic/formatter/casechanger/ShortTitleFormatter.java
#	src/main/java/org/jabref/logic/formatter/casechanger/VeryShortTitleFormatter.java
@Mtjpp
Copy link
Author

Mtjpp commented Oct 25, 2024

@koppor
Hello I have implemented unit tests can u review it please ?

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.

You can remove the tests, because the functionality of the called formatters are already tested (otherwise, I need to tell you: use @ParameterizedTest, do not prefix tests with test_ and we would need another tough round here)

I am sorry that I wrote "I think, you will find the existing tests and then you can refine them.". Here is the pointer: Add before org.jabref.logic.citationkeypattern.BracketedPatternTest#expandBracketsWithAuthorStartingWithBrackets

  1. Add a new @ParameterizedTest with @CsvSource. You see at other JabRef code how it works (use Ctrl+Shift+F).
  2. Add tests for a variant of the cases mentioned at Special field markers and modifiers #11367 (comment). Use field TITLE instead of USER_CUSTOM_TITLE_FIELD.

@koppor koppor added the status: changes required Pull requests that are not yet complete label Oct 26, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

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
status: changes required Pull requests that are not yet complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants