[core] Implement GNU-style long options and '--version'#3600
Conversation
… still figuring how to build successfully with existing unit tests
There was a problem hiding this comment.
Hi and thanks for your contribution!
This looks good overall, however, I think there's a misunderstanding about the meaning of the --use-version option. It's supposed to merge the functionality of -language and -version together, as having a pair of options is error prone. This is described in #3426
Let me know if you need help to tackle this remaing point.
--
I'll look into a way to produce a deprecation warning. We really need that I think, because -version and --version are not aliases for one another
Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
|
Hi Clément, Actually, this is my first PR for large projects. Thank you very much for reviewing my commits and providing suggestions. I just realize that I misunderstood the "--use-version", so I removed it and the corresponding unit tests I wrote before. Could you review the changes with new commits on this PR again, is it okay to be merged into some future versions? Regarding the option "--use-version", I think it may be better to work on it separately. I will work on implementing it later with issue #3426 you mentioned and also the deprecation warning in a new PR if I have time. |
Generated by 🚫 Danger |
There was a problem hiding this comment.
Hi @duanyang25,
Actually, this is my first PR for large projects.
Kudos, this is a high-quality contribution :) You're welcome to work on #3426 separately, I agree that it's a better idea. This PR looks fine to me, I'll merge it for PMD 6.41.0. Thanks for taking this on!
Note that I've now implemented the part about emitting a deprecation warning
|
Thanks again for the PR! Reminder: We also need to update the documentation at https://github.com/pmd/pmd/blob/master/docs/pages/pmd/userdocs/cli_reference.md and https://github.com/pmd/pmd/blob/master/docs/pages/pmd/userdocs/cpd/cpd.md In https://github.com/pmd/pmd/blob/master/docs/pages/pmd/userdocs/installation.md there is once used |
This reverts commit a0410bd.
…p `-language` and `-version` unchanged
|
Hi @oowekyala, Thank you for implementing the deprecation warning, and thank adangel for posting these links. I have changed them accordingly, please take a look at my new commits for these markdown files. Additionally, I put these long |
adangel
left a comment
There was a problem hiding this comment.
Thanks for updating the documentation.
I'll try to add deprecation warnings to CPD as well (similar like Clément has added to PMD CLI).
|
@all-contributors add @duanyang25 for code |
|
I've put up a pull request to add @duanyang25! 🎉 |
[core] Implement GNU-style long options and '--version' pmd#3600 * pr-3600: (24 commits) [doc] Update release notes (pmd#3600, pmd#3424, pmd#3425) docs: update docs/pages/pmd/projectdocs/credits.md [skip ci] docs: update .all-contributorsrc [skip ci] [core] Add deprecation warnings for CPD CLI options Apply suggestions from code review [doc] CPD CLI: --filelist to --file-list remove the option introduced by a mistake Update cli_reference accordingly to adopt GNU-style long options, keep `-language` and `-version` unchanged move -- options before - options change CPD.md to the new option "--fail-on-violation" Revert "change it to the new option "--fail-on-violation"" change to be the first option on of CPD change it to the new option "--fail-on-violation" Change it to `--aux-classpath` Output a deprecation warning remove and will deprecate it later seperate and current work Update description of --version add additional unit tests regarding long options, successfully implement the feature pmd#3424 and pmd#3425, and compile and build the project fix one minor issue related to 'version' ...
Describe the PR
--fail-on-violationfor CPD and kept--failOnViolationunchanged as what I did for PMD.--versionCLI option #3425 mentioned, displaying the current version of PMD. I followed Clément's suggestion so that-versionbehaves as usual, and--use-versionhas the same behavior as-version, but "--version" follows the GNU-style and displays the current version of PMD.I am an undergraduate student. One of the courses that I take this semester related to Software Engineering has assignments about fixing issues and hopefully getting merged. I have spent two weeks working on this issue alone, and I have added some unit tests and passed both them and existing tests when building it. I also tested them manually. Moreover, you are welcome to change the code that I committed. So please take a look at this PR. Thank you very much.
Related issues
--versionCLI option #3425Ready?
./mvnw clean verifypasses (checked automatically by github actions)