title: How to statically check the code of a Jenkins pipeline that uses shared libraries?
body: <p>I'm coding <a href="https://jenkins.io/doc/book/pipeline/getting-started/" rel="nofollow noreferrer">Jenkins pipelines</a> but my development process is extremely inefficient. For each modification, I must commit and push my code, and manually run the pipeline. A simple typo makes me do it all again. My version control log is a mess.</p>
  
  <p>I'm trying to use the <a href="https://jenkins.io/doc/book/pipeline/development/#linter" rel="nofollow noreferrer">Pipeline Linter</a>, but it fails since it doesn't recognize the <a href="https://jenkins.io/doc/book/pipeline/shared-libraries/" rel="nofollow noreferrer">Shared Libraries</a> that I'm using. </p>
  
  <p>Here is a simplified version of my code that I'll try to lint. This code works when I run it from the interface:</p>
  
  <pre class="lang-groovy prettyprint-override"><code>//importing class MyClass defined in src/com/company/MyClass.groovy
  import com.company.MyClass.* 
  //importing src/com/company/helper/Log.groovy
  import com.company.helper.Log;
  
  def call(String env) {
      def mud
  
      pipeline {
          agent none
  
          stages{
              stage('Checkout') {
                  agent any
                  steps {
                          mud = new MyClass(script: this)
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>I run the pipeline linter with this command:</p>
  
  <pre><code> ssh -p 8222 jenkins declarative-linter &lt; myPipeline.groovy
  </code></pre>
  
  <p>And, although it works fine when I run the pipeline in Jenkins, I get the following lint validation error:</p>
  
  <pre><code>Errors encountered validating Jenkinsfile:
  WorkflowScript: 2: unable to resolve class com.company.helper.Log
   @ line 2, column 1.
     import com.company.helper.Log;
     ^
  
  WorkflowScript: 25: unable to resolve class MyClass
   @ line 25, column 35.
                             mud = new MyClass(script: this)
  </code></pre>
  
  <p>How do I use the pipeline linter with shared libraries? </p>
  
  <p>I also welcome any help to streamline my development process!</p>