title: Kotlin Linting RuleSetProvider 'trailing-comma'
body: <p>I been trying to create a Ruleset using Pinterest <a href="https://ktlint.github.io" rel="nofollow noreferrer">ktlint</a> Library but I can't remove the part of a children parameter list.</p>
  <p><a href="https://github.com/pinterest/ktlint/issues/709" rel="nofollow noreferrer">https://github.com/pinterest/ktlint/issues/709</a></p>
  <p>Due to the update on Kotlin to support 'trailing-commas', is breaking all my static code analysis (SonarQube Gradle plugin 2.8). So I decided to create a RuleSetProvider to find a remove from the code this annoying comma ',' at the end of all the parameter list found in the project.</p>
  <pre><code>class NoTrailingCommaRule : Rule(&quot;no-trailing-comma&quot;) {
  
  override fun visit(
      node: ASTNode,
      autoCorrect: Boolean,
      emit: (offset: Int, errorMessage: String, canBeAutoCorrected: Boolean) -&gt; Unit
  ) {
      if (node.elementType == ElementType.COMMA) {
          node.parents().forEach {
              if (it.elementType == ElementType.VALUE_PARAMETER_LIST) {
                  if (it.text.contains(&quot;pepe&quot;)) {
                      println(&quot;############# IS PEPE ###############&quot;)
                      println(&quot;ParamList-&gt; &quot; + it.text)
                      println(&quot;-------------------------------------&quot;)
  
                      if (it is PsiParameterList) {
                          it.parameters.forEach { param -&gt;
                              println(&quot;   -&gt; ${param.text}&quot;)
  //                            if (next.elementType == ElementType.COMMA)
  //                                println(&quot;     -&gt; comma,&quot;)
                              println(&quot;---==---&quot;)
                          }
                          println(&quot;#####################################&quot;)
                      }
                  }
              }
          }
      }
    }
  }
  
  /// Sample class to lint
  data class PEPE(
     val pepe: String,
     var pepe1: List&lt;String&gt; = emptyList(), //&lt;- This is the kind of comma I want to remove
  ) 
  </code></pre>
  <p>Thats my current attempt of trying to get the comma and replace, but when I'm able to print the parameter line the comma is not there. </p>