You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/02/19 17:38:26 UTC

[GitHub] [maven-site] slawekjaranowski opened a new pull request #291: Example alignment for methods arguments

slawekjaranowski opened a new pull request #291:
URL: https://github.com/apache/maven-site/pull/291


   Current InteliJ formater - format code in this way - is it correct?
   
   Examples are more clear than words ;-)


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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



[GitHub] [maven-site] bmarwell commented on a change in pull request #291: Example alignment for methods arguments

Posted by GitBox <gi...@apache.org>.
bmarwell commented on a change in pull request #291:
URL: https://github.com/apache/maven-site/pull/291#discussion_r818545891



##########
File path: content/apt/developers/conventions/code.apt
##########
@@ -126,11 +126,26 @@ public class MyMojo
     // ----------------------------------------------------------------------
     ...
 
+    // multiline arguments should be aligned for method declaration
+    protected void methodOne( String arg1, String arg2,
+                              String arg3, String arg4 )

Review comment:
       No that is not what I meant.
   My idea was: EITHER chop down (one argument per line) OR everything in one line. 
   
   This is example mixed. You have both more than one line and more than one argument per line.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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



[GitHub] [maven-site] slawekjaranowski commented on a change in pull request #291: Example alignment for methods arguments

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on a change in pull request #291:
URL: https://github.com/apache/maven-site/pull/291#discussion_r817424824



##########
File path: content/apt/developers/conventions/code.apt
##########
@@ -126,11 +126,26 @@ public class MyMojo
     // ----------------------------------------------------------------------
     ...
 
+    // multiline arguments should be aligned for method declaration
+    protected void methodOne( String arg1, String arg2,
+                              String arg3, String arg4 )

Review comment:
       it is only example show position if wrapping, 
   of course if args fit in one line shouldn't be wrap




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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



[GitHub] [maven-site] michael-o commented on pull request #291: Example alignment for methods arguments

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #291:
URL: https://github.com/apache/maven-site/pull/291#issuecomment-1046102885


   > Which color do you want to paint the bikeshed? :-)
   > 
   > I prefer option 2 (consistent indent) but doing this two different ways for calls and declarations is too confusing. Pick one, or just don't bother with this at all.
   
   Agree here, formatting in `methodNext()` almost everywhere in the code aligns to the column and not 8 spaces.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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



[GitHub] [maven-site] slawekjaranowski commented on a change in pull request #291: Example alignment for methods arguments

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on a change in pull request #291:
URL: https://github.com/apache/maven-site/pull/291#discussion_r817426608



##########
File path: content/resources/developers/maven-idea-codestyle.xml
##########
@@ -92,6 +92,7 @@ under the License.
     <option name="ELSE_ON_NEW_LINE" value="true" />
     <option name="CATCH_ON_NEW_LINE" value="true" />
     <option name="FINALLY_ON_NEW_LINE" value="true" />
+    <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />

Review comment:
       I see that Intellij don't export default values ... 😄 
   i will try mentioned configuration




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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



[GitHub] [maven-site] slawekjaranowski commented on pull request #291: Example alignment for methods arguments

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on pull request #291:
URL: https://github.com/apache/maven-site/pull/291#issuecomment-1046192720


   fixed, in both case arguments are aligned


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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



[GitHub] [maven-site] bmarwell commented on a change in pull request #291: Example alignment for methods arguments

Posted by GitBox <gi...@apache.org>.
bmarwell commented on a change in pull request #291:
URL: https://github.com/apache/maven-site/pull/291#discussion_r817193582



##########
File path: content/resources/developers/maven-idea-codestyle.xml
##########
@@ -92,6 +92,7 @@ under the License.
     <option name="ELSE_ON_NEW_LINE" value="true" />
     <option name="CATCH_ON_NEW_LINE" value="true" />
     <option name="FINALLY_ON_NEW_LINE" value="true" />
+    <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />

Review comment:
       
   `      <option name="METHOD_PARAMETERS_WRAP" value="5" />`
   to chop down parameters on method declarations if too long for a single line.
   
   and maybe
   `      <option name="CALL_PARAMETERS_WRAP" value="5" />`
   for calls.
   
   At least METHOD_PARAMETERS_WRAP is missing anyway, set it to something like "wrap" (I don't know which number though).

##########
File path: content/apt/developers/conventions/code.apt
##########
@@ -126,11 +126,26 @@ public class MyMojo
     // ----------------------------------------------------------------------
     ...
 
+    // multiline arguments should be aligned for method declaration
+    protected void methodOne( String arg1, String arg2,
+                              String arg3, String arg4 )

Review comment:
       I'd prefer to "chop down" all. Either they fit in one line, or they don't. This is a suggestion to mix, which might result in more diff than needed (when refactoring).




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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