I want to fix formatting in Jenkinsfiles in VSCode 'Shift-Alt F' gives me "There is no formatter for 'groovy' files installed" and pops open an extensions sidebar with no relevant extensions that help do the formatting.
How can I format my files. Thanks. I have 'Jenkinsfile Support' and 'cod-groovy' installed. Still no dice.
Thanks.
You can use this extension https://marketplace.visualstudio.com/items?itemName=ivory-lab.jenkinsfile-support called JenkinsFile Support.
And also use the workaround defined here (using the files.associations
option of VSCode) to give linting for any file with the Jenkinsfile string in the filename https://github.com/sgwozdz/jenkinsfile-support/issues/62#issuecomment-829353453
"files.associations": {
"[Jj]enkinsfile*": "jenkinsfile"
}
If you don't want to use external extensions, you can use the groovy Id in your settings (just remember, Groovy is not one to one to Jenkinsfiles)
"files.associations": {
"[Jj]enkinsfile*": "groovy"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With