-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[test] Remove duplicated Dummy language module #2435
Comments
I didn't look into the details yet, but
would it be possible to move these tests then to pmd-core? |
I looked a bit into it, and apparently there are only two unit tests in the module. But afaik they can't be moved to pmd-core, since they need the RuleTst class |
I now think we should move PlainTextLanguage (pmd/pmd-designer#25) from the designer into the main sources of PMD core. The goal is not to write rules for plain text files, so we don't have to register this language in LanguageRegistry. We could just make it a singleton available with The advantages of this would be
|
Another possibility is to make the test classes (and resources) of pmd-core visible to the tests of other modules. This is what #4089 does for pmd-ant, to get access to dummy languages, rules and rulesets. This is maybe the easiest way. |
Is your feature request related to a problem? Please describe.
There's currently a "dummy" language module in the pmd-core test sources and one in the main pmd-test sources. They're a pain to keep in sync on the 7.0.x branch, and they're perfect duplicates. It also seems like the only usages of those DummyNodes in the pmd-test module are... in the tests of pmd-test
Describe the solution you'd like
Just make the test sources of pmd-test depend on the test sources of pmd-core, and remove the dummy module from pmd-test. https://stackoverflow.com/questions/174560/sharing-test-code-in-maven
This would remove the ability to use dummy nodes in external code that depends on pmd-test, but I think, they may use a real language module to fake nodes? I can't really think of a reason why anyone would want to build fake trees by hand outside of our test sources
Describe alternatives you've considered
The text was updated successfully, but these errors were encountered: