Accumulo
  1. Accumulo
  2. ACCUMULO-957

Modify codestyle formatter to allow turning off the formatter

    Details

    • Type: Task Task
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      The setting, "org.eclipse.jdt.core.formatter.use_on_off_tags" should be set to value "true" in the codestyle xml file for Eclipse.

      This enables overriding the formatter for specific blocks where the automatic formatter doesn't produce easy to read code. This should be used sparingly, so it doesn't allow constant circumvention of established standards.

      <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
      

      allows

        /* @formatter:off */
          int a=1, // formatter
              b=2, // is
              c=3, // off
              d=4; // for now
        /* @formatter:on */
      

      The above is not a good example, but it demonstrates what this ticket is about. It would require users to update their codestyle settings in Eclipse.

        Activity

        Hide
        Hudson added a comment -

        Integrated in Accumulo-Trunk #779 (See https://builds.apache.org/job/Accumulo-Trunk/779/)
        ACCUMULO-892 made stopAll flush tables
        ACCUMULO-957 protect the visual table from autoformat (Revision 1457190)

        Result = FAILURE
        kturner :
        Files :

        • /accumulo/trunk
        • /accumulo/trunk/assemble
        • /accumulo/trunk/core
        • /accumulo/trunk/examples
        • /accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
        • /accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
        • /accumulo/trunk/server
        • /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java
        • /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Admin.java
        • /accumulo/trunk/src
        Show
        Hudson added a comment - Integrated in Accumulo-Trunk #779 (See https://builds.apache.org/job/Accumulo-Trunk/779/ ) ACCUMULO-892 made stopAll flush tables ACCUMULO-957 protect the visual table from autoformat (Revision 1457190) Result = FAILURE kturner : Files : /accumulo/trunk /accumulo/trunk/assemble /accumulo/trunk/core /accumulo/trunk/examples /accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java /accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java /accumulo/trunk/server /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Admin.java /accumulo/trunk/src
        Hide
        Hudson added a comment -

        Integrated in Accumulo-Trunk-Hadoop-2.0 #138 (See https://builds.apache.org/job/Accumulo-Trunk-Hadoop-2.0/138/)
        ACCUMULO-892 made stopAll flush tables
        ACCUMULO-957 protect the visual table from autoformat (Revision 1457190)

        Result = UNSTABLE
        kturner :
        Files :

        • /accumulo/trunk
        • /accumulo/trunk/assemble
        • /accumulo/trunk/core
        • /accumulo/trunk/examples
        • /accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
        • /accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
        • /accumulo/trunk/server
        • /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java
        • /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Admin.java
        • /accumulo/trunk/src
        Show
        Hudson added a comment - Integrated in Accumulo-Trunk-Hadoop-2.0 #138 (See https://builds.apache.org/job/Accumulo-Trunk-Hadoop-2.0/138/ ) ACCUMULO-892 made stopAll flush tables ACCUMULO-957 protect the visual table from autoformat (Revision 1457190) Result = UNSTABLE kturner : Files : /accumulo/trunk /accumulo/trunk/assemble /accumulo/trunk/core /accumulo/trunk/examples /accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java /accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java /accumulo/trunk/server /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Admin.java /accumulo/trunk/src
        Hide
        Hudson added a comment -

        Integrated in Accumulo-1.5 #34 (See https://builds.apache.org/job/Accumulo-1.5/34/)
        ACCUMULO-957 protect the visual table from autoformat (Revision 1457088)

        Result = ABORTED
        ecn :
        Files :

        • /accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/Master.java
        Show
        Hudson added a comment - Integrated in Accumulo-1.5 #34 (See https://builds.apache.org/job/Accumulo-1.5/34/ ) ACCUMULO-957 protect the visual table from autoformat (Revision 1457088) Result = ABORTED ecn : Files : /accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/Master.java
        Hide
        Hudson added a comment -

        Integrated in Accumulo-1.5-Hadoop-2.0 #32 (See https://builds.apache.org/job/Accumulo-1.5-Hadoop-2.0/32/)
        ACCUMULO-957 protect the visual table from autoformat (Revision 1457088)

        Result = UNSTABLE
        ecn :
        Files :

        • /accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/Master.java
        Show
        Hudson added a comment - Integrated in Accumulo-1.5-Hadoop-2.0 #32 (See https://builds.apache.org/job/Accumulo-1.5-Hadoop-2.0/32/ ) ACCUMULO-957 protect the visual table from autoformat (Revision 1457088) Result = UNSTABLE ecn : Files : /accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/Master.java
        Christopher Tubbs made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in Accumulo-Trunk-Hadoop-2.0 #28 (See https://builds.apache.org/job/Accumulo-Trunk-Hadoop-2.0/28/)
        ACCUMULO-957 Enable turning formatter on/off for special use cases. Remove comment from overriding methods, and make LICENSE header comment a regular comment. (Revision 1438630)

        Result = SUCCESS
        ctubbsii :
        Files :

        • /accumulo/trunk/contrib/Eclipse-Accumulo-Codestyle.xml
        • /accumulo/trunk/contrib/Eclipse-Accumulo-Template.xml
        Show
        Hudson added a comment - Integrated in Accumulo-Trunk-Hadoop-2.0 #28 (See https://builds.apache.org/job/Accumulo-Trunk-Hadoop-2.0/28/ ) ACCUMULO-957 Enable turning formatter on/off for special use cases. Remove comment from overriding methods, and make LICENSE header comment a regular comment. (Revision 1438630) Result = SUCCESS ctubbsii : Files : /accumulo/trunk/contrib/Eclipse-Accumulo-Codestyle.xml /accumulo/trunk/contrib/Eclipse-Accumulo-Template.xml
        Hide
        Hudson added a comment -

        Integrated in Accumulo-Trunk #670 (See https://builds.apache.org/job/Accumulo-Trunk/670/)
        ACCUMULO-957 Enable turning formatter on/off for special use cases. Remove comment from overriding methods, and make LICENSE header comment a regular comment. (Revision 1438630)

        Result = SUCCESS
        ctubbsii :
        Files :

        • /accumulo/trunk/contrib/Eclipse-Accumulo-Codestyle.xml
        • /accumulo/trunk/contrib/Eclipse-Accumulo-Template.xml
        Show
        Hudson added a comment - Integrated in Accumulo-Trunk #670 (See https://builds.apache.org/job/Accumulo-Trunk/670/ ) ACCUMULO-957 Enable turning formatter on/off for special use cases. Remove comment from overriding methods, and make LICENSE header comment a regular comment. (Revision 1438630) Result = SUCCESS ctubbsii : Files : /accumulo/trunk/contrib/Eclipse-Accumulo-Codestyle.xml /accumulo/trunk/contrib/Eclipse-Accumulo-Template.xml
        Hide
        Christopher Tubbs added a comment -

        We should also change the style to make regular LICENSE header comments rather than Javadoc header comments, and to remove the comment template for overriding methods, as suggested on the dev list

        Show
        Christopher Tubbs added a comment - We should also change the style to make regular LICENSE header comments rather than Javadoc header comments, and to remove the comment template for overriding methods, as suggested on the dev list
        Hide
        Christopher Tubbs added a comment -

        I don't think this is IDE specific markup. It's just a comment to turn any formatter on/off. (We can actually use a different syntax if we want... the formatter will respect any string. @formater:on and @formater:off are only the default such strings). Regardless, it has the same semantic meaning, even to a human "formatter", of "please don't change the formatting of this section; I put it this way for a reason", regardless of the IDE features you are using.

        Show
        Christopher Tubbs added a comment - I don't think this is IDE specific markup. It's just a comment to turn any formatter on/off. (We can actually use a different syntax if we want... the formatter will respect any string. @formater:on and @formater:off are only the default such strings). Regardless, it has the same semantic meaning, even to a human "formatter", of "please don't change the formatting of this section; I put it this way for a reason", regardless of the IDE features you are using.
        Hide
        John Vines added a comment -

        They are simply comments and will not break any functionality with other IDEs. Ideally, this is markup which can be used by other IDEs as well.

        Show
        John Vines added a comment - They are simply comments and will not break any functionality with other IDEs. Ideally, this is markup which can be used by other IDEs as well.
        Hide
        William Slacum added a comment -

        The code style can be interpreted by IntelliJ, but my point wasn't anything with changing the XML file, it was that I didn't like the idea of putting the mark up in the source code itself.

        Show
        William Slacum added a comment - The code style can be interpreted by IntelliJ, but my point wasn't anything with changing the XML file, it was that I didn't like the idea of putting the mark up in the source code itself.
        Hide
        John Vines added a comment -

        The codestyle we provide is already eclipse specific, it's not compatible with any other IDEs as far as I know. If someone wants to provide a codestyle for something like IntelliJ or another IDE, it would be welcomed, and we would try to make any changes in tandem.

        Show
        John Vines added a comment - The codestyle we provide is already eclipse specific, it's not compatible with any other IDEs as far as I know. If someone wants to provide a codestyle for something like IntelliJ or another IDE, it would be welcomed, and we would try to make any changes in tandem.
        Hide
        William Slacum added a comment -

        I'm fine with it if people want it, but I don't think it's good practice to put IDE specific markup to get around overzealous automated tools.

        Show
        William Slacum added a comment - I'm fine with it if people want it, but I don't think it's good practice to put IDE specific markup to get around overzealous automated tools.
        Hide
        John Vines added a comment -

        I like this. Can the commit of this ticket include putting the state diagram in the master comments in one of these?

        Show
        John Vines added a comment - I like this. Can the commit of this ticket include putting the state diagram in the master comments in one of these?
        Christopher Tubbs created issue -

          People

          • Assignee:
            Christopher Tubbs
            Reporter:
            Christopher Tubbs
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1m
              1m
              Remaining:
              Remaining Estimate - 1m
              1m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development