Introduction to OpenRewrite
source link: https://docs.openrewrite.org/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
OpenRewrite enables large-scale distributed source code refactoring for framework migrations, vulnerability patches, and API migrations with an early focus on the Java language.
The OpenRewrite project is a semantic code search and transformation ecosystem for Java and other source code. It consists of a platform of prepackaged refactoring recipes for common framework migration and stylistic consistency tasks. It also allows you to define custom recipes to achieve a wide range of source code transformations.
OpenRewrite works by making changes to Abstract Syntax Trees (AST) representing your source code and printing the modified trees back into source code. You can then review the changes in your code and commit. Modifications to the AST are performed in Visitors and visitors are aggregated into Recipes. OpenRewrite recipes make minimally invasive changes to your source code that honor the original formatting.
For example, if you want to consistently use static imports across all of your test files, rather than doing this manually, you could use the UseStaticImport visitor provided by OpenRewrite. Applied to the file below, you can see the changes this generates.
In Getting Started, we'll learn how to configure Maven/Gradle to add OpenRewrite as a build step and then use the tools to perform from transformations.
Recommend
-
144
PowerShell Pipeline Introduction to SQL Server Management Objects with...
-
142
Open-Source Deep-Learning Software for Java and Scala on Hadoop and Spark
-
149
intro_ds_algo_py This repo contains programs from my upcoming book (to be published at the end of the year) - Introduction to Data Structures and Algorithms in Python. The language of the book is Bangla (aka Bengali), but someday I may al...
-
317
-
134
A very brief introduction to vim’s mapleader Editor’s note: this is the sixth in a series of posts on vim. If you’re new to vim then this post will make absolutely no sense, so definitely start with the fir...
-
104
This lesson will introduce you to the world of Kotlin, a new programming language by JetBrains which is now official...
-
137
An Introduction to Deep Learning for the Physical Layer An usable PyTorch implementation of the noisy autoencoder infrastructure in the paper "An Introduction to Deep Learning for the Physical Layer" by
-
130
Files Permalink Lates...
-
8
Automatic Java Code Migration with OpenRewrite (Mockito Example)Last Updated: March 14, 2022 | Published: March 14, 2022 Postponing a (major) dependency update for too long can harm our productivity...
-
10
openrewrite/rewrite: 转换升级Java或Spring代码的自动化工具...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK