-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fixed the cleanup renaming which will only rename ".pdf" files. #12396
Conversation
There was a problem hiding this 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.
Please have a look at the unit tests, guess due to limiting it to pdf now tests fail and need to be adapted by adding the extension |
… fix/11358-cleanup-renaming
@Siedlerchr made the changes, how it is looking. |
private boolean allowedFileType(String filePath) { | ||
String lowerCase = filePath.toLowerCase(); | ||
|
||
return lowerCase.endsWith(".pdf"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
public static boolean isPDFFile(Path file) { |
Please have a look at the the original issue which asks for more options than just renaming pdf files. For example, I asked if "-fig6" and the "-fig8" postfixes can be retained after renaming. :)
Currently, the postfixes are not respected and the files are categorized by extensions and ordered in their categories. |
@jiucenglou is changes looking good or need some more work ? |
LOGGER.info("Skipping renaming: {}", file.getLink()); | ||
|
||
String fullName = Path.of(file.getLink()).getFileName().toString(); | ||
int dot = fullName.lastIndexOf('.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out FileUtli. there is stuff like getFileExtension
and getBaseName
Thanks ! However it is probably necessary to use regex matching instead of looking for "-" right ? |
There was a problem hiding this 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.
Hi @Siedlerchr, |
You can ignore the failing upload-artifact action, this is sthg we have to fix in the build system. |
@@ -32,6 +33,10 @@ public RenamePdfCleanup(boolean onlyRelativePaths, Supplier<BibDatabaseContext> | |||
this.filePreferences = filePreferences; | |||
} | |||
|
|||
private boolean allowedFileType(String fileName) { | |||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing PR due to lack of quality.
@laky241 I don't mean to come off as rude, everyone has to start somewhere, but please work on basic Java and programming logic before being impatient to contribute to medium or large-scale open source projects. It wastes time for both the contributor and the maintainer, as there are way too many gaps to fill.
Have a good command over one language, build some projects, understand them end-to-end. Take your time, then come back to expand your horizon. That will go a longer way, just my two cents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @subhramit,
I appreciate your feedback and understand the importance of quality contributions. I’d like to mention that I implemented all the changes requested by @Siedlerchr and the fix has been thoroughly tested and works as expected.
However, I’m having trouble understanding what specific quality issues remain. Could you please provide more detailed guidance on which aspects of my code or approach need further improvement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should've been obvious by now. Take a look at the code window highlighted. What does it do?
Also, before your commit 4814a59, the snippet was different, and we know where such code comes from. We had already given you multiple flags in the first two PRs not to use AI when you don't know what you're doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I think what @subhramit was trying to say is: his detailed analysis of your changes lead to the assumption, that you did not see how different parts of the codebase interact with each other. In this case like changing existing tests that need very good reasoning as a test should ensure that other parts of the codebase work es expected, or how helper methods in jabref can effectively be used. @subhramit did not want to alienate you. He just thinks that starting with some issues with a smaller scope are better suited to your assumed experience with mid-to-large scale projects, to get familiarized with the whole codebase, the codestyle and modern java.
Thank you for your ongoing interest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, I’m having trouble understanding what specific quality issues remain.
At least, tests have to written for to reflect the issue. Edge cases need to be tested. There will be at least 10 different test cases IMHO. Single file, multipe files, with dash, with multiple dashes, dashes matching the generated filename, dashes not matching the generated filename, files following a pattern but not the configured one etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sincerely apologize for all the confusion or extra work I have caused. I now understand the importance of ensuring proper test coverage and maintaining the quality standards of the project. Could you please clarify how you’d like me to proceed?
Should I continue working on this issue, or would you prefer that I move on to another task?
Fixes #11358
added a new method allowedFileType which allow clean up to rename only ".pdf files"
other files like "jpeg" or "XYZ" will be skipped for renaming.