You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/07/10 12:19:32 UTC

[GitHub] [netbeans] junichi11 opened a new pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

junichi11 opened a new pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246


   https://issues.apache.org/jira/browse/NETBEANS-2981
   
   - Add `AnalysisDefaultDocumentListener` class to avoid duplicating code
   - Add `AnalysisUiUtils` class to avoid duplicating code (Browse and Search files)
   
   I added `AnalysisDefaultDocumentListener` class because there were many similar implementations of `DocumentListener`. I hope there are no problems.
   
   ### Scrrenshots
   #### Code Sniffer
   
   ##### Before
   
   ![netbeans-2981-code-sniffer-before](https://user-images.githubusercontent.com/738383/87151915-acc84600-c2ef-11ea-8339-efe5e6d29885.png)
   
   ##### After
   
   ![netbeans-2981-code-sniffer-after](https://user-images.githubusercontent.com/738383/87151948-bce02580-c2ef-11ea-9009-1a8fb339b4a2.png)
   
   #### CS Fixer
   
   ##### Before
   
   ![netbeans-2981-coding-standards-fixer-before](https://user-images.githubusercontent.com/738383/87152064-f6b12c00-c2ef-11ea-9af0-d53e372f424f.png)
   
   ##### After
   
   ![netbeans-2981-coding-standards-fixer-after](https://user-images.githubusercontent.com/738383/87152076-fd3fa380-c2ef-11ea-9f6b-10ad845785ac.png)
   
   #### Mess Detector
   
   ##### Before
   
   ![netbeans-2981-mess-detector-before](https://user-images.githubusercontent.com/738383/87152096-0466b180-c2f0-11ea-8ff4-964a4fde17c9.png)
   
   ##### After
   
   ![netbeans-2981-mess-detector-after](https://user-images.githubusercontent.com/738383/87152116-0fb9dd00-c2f0-11ea-83b1-88b11cd2c306.png)
   
   #### PHPStan
   
   ##### Before
   
   ![netbeans-2981-phpstan-before](https://user-images.githubusercontent.com/738383/87152129-16e0eb00-c2f0-11ea-8904-648e3ca43678.png)
   
   ##### After
   
   ![netbeans-2981-phpstan-after](https://user-images.githubusercontent.com/738383/87152146-2102e980-c2f0-11ea-818a-921cb96dcb6d.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
tmysik commented on pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#issuecomment-656990098


   @junichi11 BTW are the "custom" script compulsory now? :thinking:  Or if the field is empty. the default script will be used?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#issuecomment-656949626


   @tmysik Fixed : https://github.com/apache/netbeans/compare/56264dfdfd487babef518c217908eb7f1dd0de3d..84a3d25fbc3919afb0999c041ae54b284ea5fd0a
   Thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a change in pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
tmysik commented on a change in pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#discussion_r452861139



##########
File path: php/php.code.analysis/src/org/netbeans/modules/php/analysis/ui/analyzer/CodingStandardsFixerCustomizerPanel.java
##########
@@ -169,10 +194,35 @@ private void setOptions() {
     }
 
     private void setVersion1ComponentsVisible(boolean isVisible) {
-        levelLabel.setVisible(isVisible);
-        levelComboBox.setVisible(isVisible);
-        configLabel.setVisible(isVisible);
-        configComboBox.setVisible(isVisible);
+        for (Component component : getVersion1Components()) {
+            component.setVisible(isVisible);
+        }
+    }
+
+    private List<Component> getVersion1Components() {
+        return Arrays.asList(
+                levelLabel,
+                levelComboBox,
+                configLabel,
+                configComboBox
+        );
+    }
+
+    private boolean validateData() {
+        ValidatorCodingStandardsFixerParameter param = ValidatorCodingStandardsFixerParameter.create(this);
+        ValidationResult result = new AnalysisOptionsValidator()
+                .validateCodingStandardsFixer(param)
+                .getResult();
+        if (result.hasErrors()) {
+            context.setError(result.getErrors().get(0).getMessage());

Review comment:
       One day, we could add a method `getFirstError()` (and `getFirstWarning()`).
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#issuecomment-656934531


   @tmysik Thanks a lot! Will fix them.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a change in pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
tmysik commented on a change in pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#discussion_r452856459



##########
File path: php/php.code.analysis/src/org/netbeans/modules/php/analysis/options/ValidatorCodeSnifferParameter.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.analysis.options;
+
+import org.netbeans.modules.php.analysis.ui.analyzer.CodeSnifferCustomizerPanel;
+import org.netbeans.modules.php.analysis.ui.options.CodeSnifferOptionsPanel;
+
+public final class ValidatorCodeSnifferParameter {

Review comment:
       Perhaps missing `@Nullable`? On fields and/or getters...
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a change in pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
tmysik commented on a change in pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#discussion_r452856859



##########
File path: php/php.code.analysis/src/org/netbeans/modules/php/analysis/options/ValidatorCodingStandardsFixerParameter.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.php.analysis.options;
+
+import org.netbeans.modules.php.analysis.ui.analyzer.CodingStandardsFixerCustomizerPanel;
+import org.netbeans.modules.php.analysis.ui.options.CodingStandardsFixerOptionsPanel;
+import org.netbeans.modules.php.api.util.StringUtils;
+
+public final class ValidatorCodingStandardsFixerParameter {

Review comment:
       The same - missing `@Nullable`?
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
tmysik commented on pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#issuecomment-656989586


   @junichi11 Should I squash and merge?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a change in pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
tmysik commented on a change in pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#discussion_r452867135



##########
File path: php/php.code.analysis/src/org/netbeans/modules/php/analysis/ui/options/CodingStandardsFixerOptionsPanel.java
##########
@@ -304,20 +301,21 @@ public void mousePressed(java.awt.event.MouseEvent evt) {
                     .addComponent(codingStandardsFixerVersionLabel))
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addComponent(codingStandardsFixerOptionsTextField)
-                    .addGroup(layout.createSequentialGroup()
-                        .addComponent(codingStandardsFixerTextField)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(codingStandardsFixerBrowseButton)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(codingStandardsFixerSearchButton))
                     .addGroup(layout.createSequentialGroup()
                         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                             .addComponent(codingStandardsFixerVersionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                             .addComponent(codingStandardsFixerConfigComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                             .addComponent(codingStandardsFixerLevelComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                             .addComponent(codingStandardsFixerHintLabel))
-                        .addGap(0, 0, Short.MAX_VALUE))))
+                        .addGap(0, 0, Short.MAX_VALUE))
+                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()

Review comment:
       Again, FQN used in this panel...
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a change in pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
tmysik commented on a change in pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#discussion_r452862873



##########
File path: php/php.code.analysis/src/org/netbeans/modules/php/analysis/ui/analyzer/PHPStanCustomizerPanel.java
##########
@@ -221,6 +216,10 @@ private void initComponents() {
         phpStanLevelComboBox = new javax.swing.JComboBox<>();
         phpStanMemoryLimitLabel = new javax.swing.JLabel();
         phpStanMemoryLimitTextField = new javax.swing.JTextField();
+        phpStanLabel = new javax.swing.JLabel();

Review comment:
       Could we avoid using FQN here in this panel, please? It makes the code more readable, I believe. Thank you.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
tmysik commented on pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#issuecomment-656989472


   @junichi11 Great, thanks a lot!
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#issuecomment-656993554


   @tmysik There were unused imports... sorry.
   We can merge since this change should not affect CI. : https://github.com/apache/netbeans/compare/84a3d25fbc3919afb0999c041ae54b284ea5fd0a..23d9fa9ef01a13395448761fe74e0f18eb57ff4e
   
   Let's merge as it is. Maybe, it would be easy to read when someone see the logs.
   
   >  if the field is empty. the default script will be used?
   
   Yes :)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik merged pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
tmysik merged pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #2246: [NETBEANS-2981] Add script paths to code analysis customizer panels

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#issuecomment-656647510


   @tmysik Could you please review it when you can make time? Need not hurry. Next week is fine too :)
   I committed the changes per analyzer.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists