sgwozdz / jenkinsfile-support

Visual Studio Code extension
MIT License
33 stars 7 forks source link

Script could not begin with pipeline block #36

Closed laendoor closed 4 years ago

laendoor commented 4 years ago

Hi, I recent upgrade the plugin to v1.0.0 and now I have this lint error: "Script must not begin with pipeline block".

I think this is a mistake because I could write some code before pipeline, for example:

shebang groovy

#!groovy

pipeline {}

library import

@Library('myLib')

pipeline {}

or maybe some function

def myFun() {
  echo 'hello there'
}

pipeline {}

All those things are valid syntax.

Thanks!

Edit: I forgot to say that this lint error is not present in previous version (0.4.4)

divinebovine commented 4 years ago

Likewise, I'm seeing the following lint error on scripted pipelines.

"Script must begin with pipeline block"

e.g.

#! /usr/bin/env groovy
NodeLabel = 'linux'

node(NodeLabel) {
  echo 'hello world'
}
sgwozdz commented 4 years ago

that's what happen when you write extension to something you're not using on daily basics 😄 it was taken from the documentation link