Skip to content

maxandersen/rewrite-jbang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Open Rewrite as a jbang script

As an experiment from asking openrewrite/rewrite#834 I made this little script which is 97% same as the code found in https://github.com/openrewrite/rewrite-maven-plugin.

It lets you run openrewrite on any kind of project.

How to run:

  1. Install jbang (https://jbang.dev/download)

  2. You can list recipes using:

jbang rewrite@maxandersen/rewrite-jbang discover
  1. Try run it with a few recipes:

jbang rewrite@maxandersen/rewrite-jbang --recipes org.openrewrite.java.cleanup.Cleanup,org.openrewrite.java.format.AutoFormat

You can also install the script using: jbang app install https://github.com/maxandersen/rewrite-jbang/blob/master/rewrite.java and just use rewrite directly, i.e.:

rewrite --recipes org.openrewrite.java.cleanup.Cleanup,org.openrewrite.java.format.AutoFormat --dry-run

Limitations:

  • does not (yet) offer to refer to dependencies

  • totally just slammed together code a slow sunday morning!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages