Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to validade if a Groovy file is with correct syntax without running it?

I'd like to run a shell script that would tell me if a Groovy file is syntactically correct without executing it. The code wouldn't be run, just validated.

I see that there are similar questions, but I would like a simple command line command. I thought there would be parameter for the compiler, but couldn't find it.

like image 977
neves Avatar asked Oct 20 '25 10:10

neves


1 Answers

I didn't manage to get a direct answer. My problem was that I was making a Jenkins pipeline script and I'd like to verify it before commit and push. This was I would get simples errors in less time.

I've solved my problem using a VSCode Extension to validate the file before committing. No more typos in committed in my version control.

like image 136
neves Avatar answered Oct 22 '25 01:10

neves



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!