Atom-beautify: Please add support for Jenkinsfile

Created on 26 Apr 2017  路  14Comments  路  Source: Glavin001/atom-beautify

Description

Beautify detects the language (Groovy), but complains about no extension and fails to execute.

Input Before Beautification

This is what the code looked like before:

pipeline {
    agent any
    stages {
        ...
    }
}

Actual Output

N/A

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. Get error
add-beautifier add-language good first issue help wanted

Most helpful comment

Would love to see this happen!

All 14 comments

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

Please dont close!

Could you guys please provide a link to reference? I have no idea what this code looks like.

@prettydiff - here's a reference: https://jenkins.io/doc/book/pipeline/syntax/

It's based on Groovy, so most of it will be the same.

(and thank you for reopening - if I had experience with JS app development, I'd offer to help)

We are working on adapting this project to TypeScript language at https://github.com/Unibeautify/

TypeScript is JavaScript language with Java/C# like structures (interfaces and type generics) and strong typing. I don't know if that is close enough to Java/Groovy but it is closer.

@tsal can you look over #371 and see if it's the same request?

This will be very useful for those of us who still write Jenkinsfile in text editors

Be aware that there are two types: one starting node and the other pipeline. These are basically Groovy DSLs.

Would love to see this happen!

Well I have a workaround (which could be considered solution IMO). (@tsal @exuperok @texnewmex and anyone i missed )
Do as following:

  • Packages -> Atom-Beautify -> settings -> 'View code'
  • Open file(ctrl+B: javascript.coffee) : /.atom/packages/atom-beautify/javascript.coffee
  • Find array 'extensions' //it's line:17 right now.
  • add "groovy" to it
  • You are done!!! :smiley: njoy
 ###
  Supported extensions
  ###
  extensions: [
    "js",
    "groovy"
  ]

_I just started using Atom today and I am loving it so far esp the ease of extending it... wasn't able to do that all my life when using eclipse/jetBrains/netBeans_

Hello there,

I find the solution of @saurabh-sp-tripathi quite effective with a little modification: In my case the file is in .atom/packages/atom-beautify/src/languages.

Thanks for the workaround.

This solution doesn't work correctly in some cases. For example from

                            sh """
                                /usr/local/bin/git fetch --prune origin ${br}
                                /usr/local/bin/git checkout -f ${br}
                            """

it makes:

                            sh ""
                            " /
                            usr / local / bin / git fetch--prune origin $ {
                              br
                            }
                            /usr/local / bin / git checkout - f $ {
                              br
                            }
                            ""
                            "
Was this page helpful?
0 / 5 - 0 ratings

Related issues

derwaldgeist picture derwaldgeist  路  4Comments

opikhidayat picture opikhidayat  路  4Comments

ghost picture ghost  路  4Comments

bartocc picture bartocc  路  5Comments

mkermani144 picture mkermani144  路  4Comments