title: Use ktlint to format during maven build
body: <p>I used the following settings for ktlint which allowed auto-formatting for all files during a local maven build but never triggered a pipeline failure if formatting was incorrect:</p>
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;com.github.gantsign.maven&lt;/groupId&gt;
      &lt;artifactId&gt;ktlint-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.6.1&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
          &lt;id&gt;format-and-check&lt;/id&gt;
          &lt;goals&gt;
              &lt;goal&gt;format&lt;/goal&gt;
              &lt;goal&gt;check&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  <p>For ktlint to trigger a pipeline failure if formatting is incorrect I changed the settings to</p>
  <pre><code>&lt;execution&gt;
      &lt;id&gt;verify-code-style&lt;/id&gt;
      &lt;phase&gt;validate&lt;/phase&gt;
      &lt;goals&gt;
          &lt;goal&gt;check&lt;/goal&gt;
      &lt;/goals&gt;
  &lt;/execution&gt;
  </code></pre>
  <p>Which does trigger a failure instantly.</p>
  <p>But - now I cannot do a local maven build and make use of auto-formatting. Instead it instantly triggers a failure, requiring manual action for example <code>Needless blank line(s)</code> in class X on line Y.</p>
  <p>I would like to have the best of both worlds - trigger a failure in the pipeline and make use of auto-formatting locally. Is there any way to achieve this?</p>