Glavin001 / atom-beautify

:mega: Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | :lipstick: Universal beautification package for Atom editor (:warning: Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding :heart: )
http://unibeautify.com/
MIT License
1.5k stars 453 forks source link

Please add support for Jenkinsfile #1628

Open tsal opened 7 years ago

tsal commented 7 years ago

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
stale[bot] commented 7 years ago

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.

ahharu commented 7 years ago

Please dont close!

prettydiff commented 7 years ago

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

tsal commented 7 years ago

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

tsal commented 7 years ago

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

tsal commented 7 years ago

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

prettydiff commented 7 years ago

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.

stevenzeck commented 7 years ago

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

ghost commented 6 years ago

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

snowblink commented 6 years ago

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

texnewmex commented 6 years ago

Would love to see this happen!

saurabh-sp-tripathi commented 6 years ago

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

 ###
  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

tluquez commented 6 years ago

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.

dubrsl commented 6 years ago

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
                            }
                            ""
                            "