-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove recommend config of enum (#521)
- Loading branch information
Showing
8 changed files
with
132 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
140 changes: 90 additions & 50 deletions
140
...in/src/test/kotlin/com/itangcent/idea/plugin/settings/helper/RecommendConfigLoaderTest.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,37 +25,37 @@ internal class RecommendConfigSettingsHelperTest : SettingsHelperTest() { | |
|
||
@Test | ||
fun testLoadRecommendConfig() { | ||
settings.recommendConfigs = "-Jackson_JsonIgnoreProperties,-converts,-yapi_tag,-spring.ui,-import_spring_properties,-support_mock_for_general,-deprecated_java,-deprecated_kotlin,-spring_Entity,-spring_webflux,-javax.validation,-javax.validation(grouped),-support_mock_for_javax_validation" | ||
assertEquals("#Get the module from the comment,group the apis\n" + | ||
"module=#module\n" + | ||
"#Ignore class/api\n" + | ||
"ignore=#ignore\n" + | ||
"#Support for Jackson annotations\n" + | ||
"[email protected]#value\n" + | ||
"[email protected]#value\n" + | ||
"#Support for Gson annotations\n" + | ||
"field.name=@com.google.gson.annotations.SerializedName#value\n" + | ||
"[email protected]#serialize\n" + | ||
"#ignore transient field\n" + | ||
"field.ignore=groovy:it.hasModifier(\"transient\")\n" + | ||
"#Support spring.validations\n" + | ||
"field.[email protected]\n" + | ||
"param.ignore=groovy:it.type().isExtend(\"org.springframework.validation.BindingResult\")\n" + | ||
"#Support spring file\n" + | ||
"type.is_file=groovy:it.isExtend(\"org.springframework.web.multipart.MultipartFile\")\n" + | ||
"#yapi tag for kotlin\n" + | ||
"api.tag[@kotlin.Deprecated]=deprecated\n" + | ||
"api.tag[groovy:it.containingClass().hasAnn(\"kotlin.Deprecated\")]=deprecated\n" + | ||
"#yapi status\n" + | ||
"api.status[#undone]=undone\n" + | ||
"api.status[#todo]=undone\n" + | ||
"#yapi mock\n" + | ||
"field.mock=#mock\n" + | ||
"#ignore serialVersionUID\n" + | ||
"constant.field.ignore=groovy:it.name()==\"serialVersionUID\"\n" + | ||
"#support the common ways to use enum\n" + | ||
"enum.use.name=groovy:it.type().name()==\"java.lang.String\"\n" + | ||
"enum.use.ordinal=groovy:it.type().name()==\"int\"\n" + | ||
"enum.use.ordinal=groovy:it.type().name()==\"java.lang.Integer\"", recommendConfigSettingsHelper.loadRecommendConfig().toUnixString()) | ||
settings.recommendConfigs = | ||
"-Jackson_JsonIgnoreProperties,-converts,-yapi_tag,-spring.ui,-import_spring_properties,-support_mock_for_general,-deprecated_java,-deprecated_kotlin,-spring_Entity,-spring_webflux,-javax.validation,-javax.validation(grouped),-support_mock_for_javax_validation" | ||
assertEquals( | ||
"#Get the module from the comment,group the apis\n" + | ||
"module=#module\n" + | ||
"#Ignore class/api\n" + | ||
"ignore=#ignore\n" + | ||
"#Support for Jackson annotations\n" + | ||
"[email protected]#value\n" + | ||
"field.ignore=@com.fasterxml.jackson.annotation.JsonIgnore#value\n" + | ||
"#Support for Gson annotations\n" + | ||
"field[email protected]#value\n" + | ||
"field.ignore=[email protected]#serialize\n" + | ||
"#ignore transient field\n" + | ||
"field.ignore=groovy:it.hasModifier(\"transient\")\n" + | ||
"#Support spring.validations\n" + | ||
"[email protected]\n" + | ||
"param.ignore=groovy:it.type().isExtend(\"org.springframework.validation.BindingResult\")\n" + | ||
"#Support spring file\n" + | ||
"type.is_file=groovy:it.isExtend(\"org.springframework.web.multipart.MultipartFile\")\n" + | ||
"#yapi tag for kotlin\n" + | ||
"api.tag[@kotlin.Deprecated]=deprecated\n" + | ||
"api.tag[groovy:it.containingClass().hasAnn(\"kotlin.Deprecated\")]=deprecated\n" + | ||
"#yapi status\n" + | ||
"api.status[#undone]=undone\n" + | ||
"api.status[#todo]=undone\n" + | ||
"#yapi mock\n" + | ||
"field.mock=#mock\n" + | ||
"#ignore serialVersionUID\n" + | ||
"constant.field.ignore=groovy:it.name()==\"serialVersionUID\"", | ||
recommendConfigSettingsHelper.loadRecommendConfig().toUnixString() | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters