https://github.com/maxandersen/rewrite-jbang
https://github.com/maxandersen/rewrite-jbang
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/maxandersen/rewrite-jbang
- Owner: maxandersen
- Created: 2021-07-25T10:22:10.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-05T07:00:25.000Z (almost 2 years ago)
- Last Synced: 2025-04-12T06:07:45.598Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 11.7 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.adoc
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!