Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-25551

Format Checker: dont enforce line feed

XMLWordPrintable

      Current format checks enforce line feeds which leads to badly readable code when you're using fluent builders like in the following case (see here: https://github.com/jbosstools/jbosstools-openshift/pull/1645/files?diff=unified#diff-16258aa0fb1a1d1ebc6bdc47a6604682R220):

      enforced line feeds
      TableViewer resourcesViewer = new TableViewerBuilder(table, tableContainer)
       	.column(resource -> ((IResource) resource).getName()).name("Name").align(SWT.LEFT).weight(1)
      	.minWidth(100).buildColumn().column(resource -> ((IResource) resource).getKind()).name("Type")
       	.align(SWT.LEFT).weight(1).minWidth(100).buildColumn()
       	.column(new LabelsCellLabelProvider(labelFilter)).name("Labels").align(SWT.LEFT).weight(2)
       	.minWidth(200).buildColumn().buildViewer();
      
      manual line feeds with superior readability
      TableViewer resourcesViewer = new TableViewerBuilder(table, tableContainer)
      	.column(resource -> ((IResource) resource).getName())
                  .name("Name").align(SWT.LEFT).weight(1).minWidth(100).buildColumn()
              .column(resource -> ((IResource) resource).getKind())
                  .name("Type").align(SWT.LEFT).weight(1).minWidth(100).buildColumn()
      	.column(new LabelsCellLabelProvider(labelFilter))
                  .name("Labels").align(SWT.LEFT).weight(2).minWidth(200).buildColumn()
             .buildViewer();
      

            dbocharo@redhat.com Dmitrii Bocharov (Inactive)
            adietish@redhat.com André Dietisheim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: