An open API service indexing awesome lists of open source software.

https://github.com/maxandersen/rewrite-jbang


https://github.com/maxandersen/rewrite-jbang

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# Open Rewrite as a jbang script

As an experiment from asking https://github.com/openrewrite/rewrite/discussions/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
```
3. 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!