Skip to content

Commit 9ce4f80

Browse files
committed
Add 200+ new recipes
1 parent e796b6b commit 9ce4f80

File tree

572 files changed

+12948
-75
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

572 files changed

+12948
-75
lines changed

_build/Build.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,18 +302,18 @@ grep dotnet |
302302
// var recipeManager = new RecipeManager();
303303
// CA1802: Use Literals Where Appropriate
304304
// CA1861: Avoid constant arrays as arguments
305-
var packages = new(string Package, string Version)[]
305+
var packages = new(string Package, bool PreRelease)[]
306306
{
307-
("Microsoft.CodeAnalysis.NetAnalyzers", "9.0.0"), //https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories
308-
("Roslynator.Analyzers", "4.13.1"), //https://github.com/dotnet/roslynator
309-
("Meziantou.Analyzer", "2.0.201"), //https://github.com/meziantou/Meziantou.Analyzer
310-
("StyleCop.Analyzers", "1.1.118"), //https://github.com/DotNetAnalyzers/StyleCopAnalyzers/tree/master
311-
("WpfAnalyzers", "4.1.1"),
307+
("Microsoft.CodeAnalysis.NetAnalyzers", false), //https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories
308+
("Roslynator.Analyzers", false), //https://github.com/dotnet/roslynator
309+
("Meziantou.Analyzer", false), //https://github.com/meziantou/Meziantou.Analyzer
310+
("StyleCop.Analyzers", false), //https://github.com/DotNetAnalyzers/StyleCopAnalyzers/tree/master
311+
("WpfAnalyzers", false),
312312
};
313313

314-
var installablePackages = await Task.WhenAll(packages.Select(x => recipeManager.InstallRecipePackage(x.Package, x.Version, packageSources: packageSources)));
314+
var installablePackages = await Task.WhenAll(packages.Select(x => recipeManager.InstallRecipePackage(x.Package, packageSources: packageSources)));
315315
var recipesDir = RootDirectory / "rewrite-csharp" / "src" / "main" / "java" / "org" / "openrewrite" / "csharp" / "recipes";
316-
316+
recipesDir.CreateOrCleanDirectory();
317317
var models = installablePackages.SelectMany(packageInfo => packageInfo.Recipes.Select(recipe =>
318318
{
319319
var className = recipe.Id.StartsWith(recipe.TypeName) ? recipe.Id : recipe.TypeName.FullName.Split('.').Last();
@@ -335,6 +335,12 @@ grep dotnet |
335335
var license = File.ReadAllText(Solution._solution._build.Directory / "License.txt").Trim();
336336
var result = models.Select(model => (model.FileName, Content: $$""""
337337
{{license}}
338+
/*
339+
* -------------------THIS FILE IS AUTO GENERATED--------------------------
340+
* Changes to this file may cause incorrect behavior and will be lost if
341+
* the code is regenerated.
342+
*/
343+
338344
package org.openrewrite.csharp.recipes.{{model.Namespace}};
339345
340346
import org.openrewrite.NlsRewrite;

_build/_build.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</ItemGroup>
2424
<ItemGroup>
2525
<!-- <ProjectReference Include="..\Rewrite\src\Rewrite.MSBuild\Rewrite.MSBuild.csproj" Condition="'$(Generator)' == ''" />-->
26-
<PackageReference Include="Rewrite.MSBuild" Version="[0.24.37-gfd2ee8766e]" />
26+
<PackageReference Include="Rewrite.MSBuild" Version="0.27.3" />
2727

2828
<ProjectReference Include="..\_build.Analyzers\Build.Analyzers.csproj"
2929
OutputItemType="Analyzer">

rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/AbstractTypesShouldNotHaveConstructorsMA0017.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
/*
17+
* -------------------THIS FILE IS AUTO GENERATED--------------------------
18+
* Changes to this file may cause incorrect behavior and will be lost if
19+
* the code is regenerated.
20+
*/
21+
1622
package org.openrewrite.csharp.recipes.meziantou.analyzer;
1723

1824
import org.openrewrite.NlsRewrite;
@@ -32,7 +38,7 @@ public String getNugetPackageName() {
3238

3339
@Override
3440
public String getNugetPackageVersion() {
35-
return "2.0.201";
41+
return "2.0.205";
3642
}
3743

3844
@Override

rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/ArgumentExceptionShouldSpecifyArgumentNameMA0043.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
/*
17+
* -------------------THIS FILE IS AUTO GENERATED--------------------------
18+
* Changes to this file may cause incorrect behavior and will be lost if
19+
* the code is regenerated.
20+
*/
21+
1622
package org.openrewrite.csharp.recipes.meziantou.analyzer;
1723

1824
import org.openrewrite.NlsRewrite;
@@ -32,7 +38,7 @@ public String getNugetPackageName() {
3238

3339
@Override
3440
public String getNugetPackageVersion() {
35-
return "2.0.201";
41+
return "2.0.205";
3642
}
3743

3844
@Override

rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/AvoidComparisonWithBoolConstantMA0073.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
/*
17+
* -------------------THIS FILE IS AUTO GENERATED--------------------------
18+
* Changes to this file may cause incorrect behavior and will be lost if
19+
* the code is regenerated.
20+
*/
21+
1622
package org.openrewrite.csharp.recipes.meziantou.analyzer;
1723

1824
import org.openrewrite.NlsRewrite;
@@ -32,7 +38,7 @@ public String getNugetPackageName() {
3238

3339
@Override
3440
public String getNugetPackageVersion() {
35-
return "2.0.201";
41+
return "2.0.205";
3642
}
3743

3844
@Override

rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/AvoidUsingRedundantElseMA0071.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
/*
17+
* -------------------THIS FILE IS AUTO GENERATED--------------------------
18+
* Changes to this file may cause incorrect behavior and will be lost if
19+
* the code is regenerated.
20+
*/
21+
1622
package org.openrewrite.csharp.recipes.meziantou.analyzer;
1723

1824
import org.openrewrite.NlsRewrite;
@@ -32,7 +38,7 @@ public String getNugetPackageName() {
3238

3339
@Override
3440
public String getNugetPackageVersion() {
35-
return "2.0.201";
41+
return "2.0.205";
3642
}
3743

3844
@Override

rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/ClassMustBeSealedMA0053.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
/*
17+
* -------------------THIS FILE IS AUTO GENERATED--------------------------
18+
* Changes to this file may cause incorrect behavior and will be lost if
19+
* the code is regenerated.
20+
*/
21+
1622
package org.openrewrite.csharp.recipes.meziantou.analyzer;
1723

1824
import org.openrewrite.NlsRewrite;
@@ -32,7 +38,7 @@ public String getNugetPackageName() {
3238

3339
@Override
3440
public String getNugetPackageVersion() {
35-
return "2.0.201";
41+
return "2.0.205";
3642
}
3743

3844
@Override

rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/CommaMA0007.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
/*
17+
* -------------------THIS FILE IS AUTO GENERATED--------------------------
18+
* Changes to this file may cause incorrect behavior and will be lost if
19+
* the code is regenerated.
20+
*/
21+
1622
package org.openrewrite.csharp.recipes.meziantou.analyzer;
1723

1824
import org.openrewrite.NlsRewrite;
@@ -32,7 +38,7 @@ public String getNugetPackageName() {
3238

3339
@Override
3440
public String getNugetPackageVersion() {
35-
return "2.0.201";
41+
return "2.0.205";
3642
}
3743

3844
@Override

rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/DoNotRemoveOriginalExceptionFromThrowStatementMA0027.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
/*
17+
* -------------------THIS FILE IS AUTO GENERATED--------------------------
18+
* Changes to this file may cause incorrect behavior and will be lost if
19+
* the code is regenerated.
20+
*/
21+
1622
package org.openrewrite.csharp.recipes.meziantou.analyzer;
1723

1824
import org.openrewrite.NlsRewrite;
@@ -32,7 +38,7 @@ public String getNugetPackageName() {
3238

3339
@Override
3440
public String getNugetPackageVersion() {
35-
return "2.0.201";
41+
return "2.0.205";
3642
}
3743

3844
@Override

rewrite-csharp/src/main/java/org/openrewrite/csharp/recipes/meziantou/analyzer/DoNotUseBlockingCallInAsyncContextMA0042.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
/*
17+
* -------------------THIS FILE IS AUTO GENERATED--------------------------
18+
* Changes to this file may cause incorrect behavior and will be lost if
19+
* the code is regenerated.
20+
*/
21+
1622
package org.openrewrite.csharp.recipes.meziantou.analyzer;
1723

1824
import org.openrewrite.NlsRewrite;
@@ -32,7 +38,7 @@ public String getNugetPackageName() {
3238

3339
@Override
3440
public String getNugetPackageVersion() {
35-
return "2.0.201";
41+
return "2.0.205";
3642
}
3743

3844
@Override

0 commit comments

Comments
 (0)