You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Elliotte Rusty Harold (Jira)" <ji...@apache.org> on 2019/12/15 12:18:00 UTC

[jira] [Closed] (MNGSITE-385) Code style should mention "else" style

     [ https://issues.apache.org/jira/browse/MNGSITE-385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elliotte Rusty Harold closed MNGSITE-385.
-----------------------------------------

> Code style should mention "else" style
> --------------------------------------
>
>                 Key: MNGSITE-385
>                 URL: https://issues.apache.org/jira/browse/MNGSITE-385
>             Project: Maven Project Web Site
>          Issue Type: Task
>            Reporter: Benjamin Marwell
>            Assignee: Elliotte Rusty Harold
>            Priority: Major
>
> Hello,
> the "code style page" at [https://maven.apache.org/developers/conventions/code.html] should mention the code style associated with the {{else}} keyword.
> Example: I created my first PR using guard statements and kept the main code on the lowest possible indentation level. Only the reviwers told me that this is uncommon in apache projects and not wanted. While I do not go with "it's clearer to read", it is more common to read if you are used to it not to see any code without indentation.
> Here's my PR with the discussion: [https://github.com/apache/maven-checkstyle-plugin/pull/17.] You can clearly see how I struggled and was suprised with the comments, as checkstyle did went through anyway.
> That said, if this is what is wanted, this should be mentioned on the code conventions page as well. Maybe even add a checkstyle rule ("no if containing break/return" and "no if without else"). While I myself prefer to use guard statements, it seems uncommon for apache projects.
> Please update the documentation rules accordingly.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)