Closed KacerCZ closed 4 years ago
@tmysik @junichi11 Please advise/help how to deal with selection of built-in rules (codesize, design, ...). When rule set file is selected, then built-in rules don't have to be selected. Mess detector will work only with rules in file.
Validation of settings was already modified to handle this case. Problem is with selection of built-in rules. It seems that it is not possible for JList to have nothing selected.
@KacerCZ
What about just disabling the Default Rule Sets field if Rule Set File is selected?
CC @junichi11
@tmysik Default rules can be combined with custom rules in file - see http://phpmd.org/documentation/index.html My intention is to make Default Rule Sets optional, so using only custom rule set would be possible.
@KacerCZ
I am not sure I understand. So - what about adding a checkbox that would enable Default Rule Sets field? Would that work? :thinking:
@KacerCZ
BTW looking at the attached images, I guess that the Rule Set File textfield should be as long as the other 2 text fields above (it means that both the Browse... buttons would be aligned and after the new one, there would be a free space).
What do you think?
CC @junichi11
I would add an empty string or whitespace to the list if that's possible. Or I would change the label to a checkbox as @tmysik wrote.
BTW looking at the attached images, I guess that the Rule Set File textfield should be as long as the other 2 text fields above (it means that both the Browse... buttons would be aligned and after the new one, there would be a free space).
Agree.
@junichi11 I added whitespace to list of built-in rule sets and made sure it does not goes into command parameters. @tmysik I fixed alignment of Browse button as you suggested. Same alignment issue is in configuration for PHPStan, shall I prepare PR to fix it?
Options after changes:
Inspection customization:
Please review.
UPDATE: Now I see that your change is only the empty item in the Rule Sets field, right? I really need to check yout and run your branch, sorry.
The original comment follows:
@KacerCZ
The last screenshot looks a bit unusually to me, I mean the Enabled checkbox. Try to look at some other dialogs in NetBeans, I would expect more the checkbox directly at Rule Sets label. Or does the checkbox enable te whole form (both Rule Sets as well as Rule Set File)?
(Sorry, did not get time to checkout your branch and try it, will try to do it.)
Thank you.
CC @junichi11
@tmysik Yes, I added empty item to list selection of predefined rules. This empty item is ignored when parameters for Mess detector are created. Valid cases are:
The second screenshot is from inspection customization dialog. Enabled checkbox enables running of selected analyzer in given configuration.
One quick note - maybe instead of an empty item in the list, we could add something like <ignored> or <unused> or similarly. What do you think?
One quick note - maybe instead of an empty item in the list, we could add something like
or or similarly.
Nice idea :) It's easy to understand, I think.
BTW, I added the Enabled
checkbox before because all analyzers are run when a user customizes a configuration if the checkbox doesn't exist.
I replaced empty string with <none> and updated validation. I added missing listener for rule set file textfield in MessDetectorCustomizerPanel (rule set file was not saved after change).
@junichi11
Junichi, please, just to be sure - could you test whether it works? I am sorry, I am really busy now and did not get to try it myself :/
@KacerCZ
Well done!
Thank you.
@tmysik Yes, I'll test it later :)
BTW, We should be able to merge PRs again: https://lists.apache.org/thread.html/r619a782b9e828bd62324817b6ae96f93cfab0dd0ea1f67edcfce25c6%40%3Cdev.netbeans.apache.org%3E
@junichi11
Thanks a lot! :bow:
@KacerCZ I can't edit "Rule Set File" of the Configurations dialog.
@junichi11 Fixed enabling/disabling of File controls. Thank you.
@KacerCZ BTW, You should submit icla because we would like to avoid troubles for the license. see: https://www.apache.org/licenses/contributor-agreements.html
Then, As this case, if example data(e.g. ruleset.xml, example code) for testing are needed, please attach them to the JIRA as much as possible. Otherwise, each reviewer has to create data from scratch.
@junichi11 I sent signed ICLA to ASF.
I sent signed ICLA to ASF.
Thanks!
Let's merge it after the unused import is fixed.
@tmysik Could you please merge this if it's OK with you?
@KacerCZ
Well done! Thanks!
@junichi11
Thank you too!
@tmysik @junichi11 Thank you for your guidance and patience.
Add option to select custom rule set file in PHP Mess Detector configuration. Customizer panel is also updated.
https://issues.apache.org/jira/browse/NETBEANS-4339
Before:
After: