Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new rule field.advanced #605

Merged
merged 1 commit into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {

implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

implementation('com.itangcent:commons:1.0.91-SNAPSHOT') {
implementation('com.itangcent:commons:1.0.9') {
exclude group: 'com.google.inject'
exclude group: 'com.google.code.gson'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ object Attrs {

const val EXAMPLE_ATTR = "@example"

const val ADVANCED_ATTR = "@advanced"

const val PREFIX = "@"

val ALL = arrayOf(COMMENT_ATTR, REQUIRED_ATTR, MOCK_ATTR, DEFAULT_VALUE_ATTR, EXAMPLE_ATTR)
val ALL = arrayOf(COMMENT_ATTR, REQUIRED_ATTR, MOCK_ATTR, DEFAULT_VALUE_ATTR, EXAMPLE_ATTR, ADVANCED_ATTR)
}
8 changes: 4 additions & 4 deletions idea-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])


implementation('com.itangcent:intellij-idea:1.0.91-SNAPSHOT') {
implementation('com.itangcent:intellij-idea:1.0.9') {
exclude group: 'com.google.inject'
exclude group: 'com.google.code.gson'
}

implementation('com.itangcent:intellij-kotlin-support:1.0.91-SNAPSHOT') {
implementation('com.itangcent:intellij-kotlin-support:1.0.9') {
exclude group: 'com.google.inject'
exclude group: 'com.google.code.gson'
}

// implementation('com.itangcent:intellij-scala-support:1.0.91-SNAPSHOT') {
// implementation('com.itangcent:intellij-scala-support:1.0.9') {
// exclude group: 'com.google.inject'
// exclude group: 'com.google.code.gson'
// }
Expand Down Expand Up @@ -122,7 +122,7 @@ dependencies {
// https://mvnrepository.com/artifact/org.mockito/mockito-inline
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '3.11.0'

testImplementation('com.itangcent:intellij-idea-test:1.0.91-SNAPSHOT') {
testImplementation('com.itangcent:intellij-idea-test:1.0.9') {
exclude group: 'com.nhaarman.mockitokotlin2', module: 'mockito-kotlin'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,86 +5,86 @@ import com.itangcent.intellij.config.rule.*
object ClassExportRuleKeys {

val MODULE: RuleKey<String> = SimpleRuleKey(
"module", StringRule::class,
"module",
StringRuleMode.SINGLE
)

val IGNORE: RuleKey<Boolean> = SimpleRuleKey(
"ignore", BooleanRule::class,
"ignore",
BooleanRuleMode.ANY
)

val IS_CTRL: RuleKey<Boolean> = SimpleRuleKey(
"class.is.ctrl", BooleanRule::class,
"class.is.ctrl",
BooleanRuleMode.ANY
)

//filter class for methodDoc(rpc)
val CLASS_FILTER: RuleKey<Boolean> = SimpleRuleKey(
"mdoc.class.filter", BooleanRule::class,
"mdoc.class.filter",
BooleanRuleMode.ANY
)

//filter method for methodDoc(rpc)
val METHOD_FILTER: RuleKey<Boolean> = SimpleRuleKey(
"mdoc.method.filter", BooleanRule::class,
"mdoc.method.filter",
BooleanRuleMode.ANY
)

val METHOD_DOC_PATH: RuleKey<String> = SimpleRuleKey("mdoc.method.path", StringRule::class,
val METHOD_DOC_PATH: RuleKey<String> = SimpleRuleKey("mdoc.method.path",
StringRuleMode.SINGLE)

val METHOD_DOC_METHOD: RuleKey<String> = SimpleRuleKey("mdoc.method.http.method", StringRule::class,
val METHOD_DOC_METHOD: RuleKey<String> = SimpleRuleKey("mdoc.method.http.method",
StringRuleMode.SINGLE)

val PARAM_DOC: RuleKey<String> = SimpleRuleKey(
"param.doc",
arrayOf("doc.param"),
StringRule::class,

StringRuleMode.MERGE_DISTINCT
)

val METHOD_DOC: RuleKey<String> = SimpleRuleKey(
"method.doc",
arrayOf("doc.method"),
StringRule::class,

StringRuleMode.MERGE_DISTINCT
)

val CLASS_DOC: RuleKey<String> = SimpleRuleKey(
"class.doc",
arrayOf("doc.class"),
StringRule::class,

StringRuleMode.MERGE_DISTINCT
)

val METHOD_ADDITIONAL_HEADER: RuleKey<String> = SimpleRuleKey(
"method.additional.header", StringRule::class,
"method.additional.header",
StringRuleMode.MERGE_DISTINCT
)

val METHOD_ADDITIONAL_PARAM: RuleKey<String> = SimpleRuleKey(
"method.additional.param", StringRule::class,
"method.additional.param",
StringRuleMode.MERGE_DISTINCT
)

val METHOD_ADDITIONAL_RESPONSE_HEADER: RuleKey<String> = SimpleRuleKey(
"method.additional.response.header", StringRule::class,
"method.additional.response.header",
StringRuleMode.MERGE_DISTINCT
)

val PARAM_REQUIRED: RuleKey<Boolean> = SimpleRuleKey(
"param.required", BooleanRule::class,
"param.required",
BooleanRuleMode.ANY
)

val PARAM_IGNORE: RuleKey<Boolean> = SimpleRuleKey(
"param.ignore", BooleanRule::class,
"param.ignore",
BooleanRuleMode.ANY
)

val PARAM_DEFAULT_VALUE: RuleKey<String> = SimpleRuleKey(
"param.default.value", StringRule::class,
"param.default.value",
StringRuleMode.MERGE_DISTINCT
)

Expand All @@ -99,36 +99,36 @@ object ClassExportRuleKeys {
)

val FIELD_REQUIRED: RuleKey<Boolean> = SimpleRuleKey(
"field.required", BooleanRule::class,
"field.required",
BooleanRuleMode.ANY
)

val CLASS_PREFIX_PATH: RuleKey<String> = SimpleRuleKey(
"class.prefix.path", StringRule::class,
"class.prefix.path",
StringRuleMode.SINGLE
)

/**
* the main goal of the {@return}
*/
val METHOD_RETURN_MAIN: RuleKey<String> = SimpleRuleKey(
"method.return.main", StringRule::class,
"method.return.main",
StringRuleMode.SINGLE
)

/**
* the real return type of method
*/
val METHOD_RETURN: RuleKey<String> = SimpleRuleKey(
"method.return", StringRule::class,
"method.return",
StringRuleMode.SINGLE
)

/**
* The content-type of the api.
*/
val METHOD_CONTENT_TYPE: RuleKey<String> = SimpleRuleKey(
"method.content.type", StringRule::class,
"method.content.type",
StringRuleMode.SINGLE
)

Expand All @@ -138,44 +138,44 @@ object ClassExportRuleKeys {
* should return body/form/query
*/
val PARAM_HTTP_TYPE: RuleKey<String> = SimpleRuleKey(
"param.http.type", StringRule::class,
"param.http.type",
StringRuleMode.SINGLE
)

/**
* name of api
*/
val API_NAME: RuleKey<String> = SimpleRuleKey(
"api.name", StringRule::class,
"api.name",
StringRuleMode.SINGLE
)

/**
* folder of api
*/
val API_FOLDER: RuleKey<String> = SimpleRuleKey(
"folder.name", StringRule::class,
"folder.name",
StringRuleMode.SINGLE
)

//default http method of api(method)
val METHOD_DEFAULT_HTTP_METHOD: RuleKey<String> = SimpleRuleKey(
"method.default.http.method", StringRule::class,
"method.default.http.method",
StringRuleMode.SINGLE
)

val FIELD_MOCK: RuleKey<String> = SimpleRuleKey(
"field.mock", StringRule::class,
"field.mock",
StringRuleMode.SINGLE
)

val FIELD_DEFAULT_VALUE: RuleKey<String> = SimpleRuleKey(
"field.default.value", StringRule::class,
"field.default.value",
StringRuleMode.SINGLE
)

val POST_MAN_HOST: RuleKey<String> = SimpleRuleKey(
"postman.host", StringRule::class,
"postman.host",
StringRuleMode.SINGLE
)

Expand All @@ -190,7 +190,7 @@ object ClassExportRuleKeys {
)

val PATH_MULTI: RuleKey<String> = SimpleRuleKey(
"path.multi", StringRule::class,
"path.multi",
StringRuleMode.SINGLE
)

Expand All @@ -200,7 +200,7 @@ object ClassExportRuleKeys {
* @see [https://learning.postman.com/docs/writing-scripts/pre-request-scripts]
*/
val POST_PRE_REQUEST: RuleKey<String> = SimpleRuleKey(
"postman.prerequest", StringRule::class,
"postman.prerequest",
StringRuleMode.MERGE
)

Expand All @@ -211,7 +211,7 @@ object ClassExportRuleKeys {
* @see [https://learning.postman.com/docs/writing-scripts/pre-request-scripts]
*/
val CLASS_POST_PRE_REQUEST: RuleKey<String> = SimpleRuleKey(
"class.postman.prerequest", StringRule::class,
"class.postman.prerequest",
StringRuleMode.MERGE
)

Expand All @@ -222,7 +222,7 @@ object ClassExportRuleKeys {
* @see [https://learning.postman.com/docs/writing-scripts/pre-request-scripts]
*/
val COLLECTION_POST_PRE_REQUEST: RuleKey<String> = SimpleRuleKey(
"collection.postman.prerequest", StringRule::class,
"collection.postman.prerequest",
StringRuleMode.MERGE
)

Expand All @@ -232,7 +232,7 @@ object ClassExportRuleKeys {
* @see [https://learning.postman.com/docs/writing-scripts/test-scripts/]
*/
val POST_TEST: RuleKey<String> = SimpleRuleKey(
"postman.test", StringRule::class,
"postman.test",
StringRuleMode.MERGE
)

Expand All @@ -243,7 +243,7 @@ object ClassExportRuleKeys {
* @see [https://learning.postman.com/docs/writing-scripts/test-scripts/]
*/
val CLASS_POST_TEST: RuleKey<String> = SimpleRuleKey(
"class.postman.test", StringRule::class,
"class.postman.test",
StringRuleMode.MERGE
)

Expand All @@ -254,7 +254,7 @@ object ClassExportRuleKeys {
* @see [https://learning.postman.com/docs/writing-scripts/test-scripts/]
*/
val COLLECTION_POST_TEST: RuleKey<String> = SimpleRuleKey(
"collection.postman.test", StringRule::class,
"collection.postman.test",
StringRuleMode.MERGE
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,67 @@ import com.itangcent.intellij.config.rule.*
object GenericClassExportRuleKeys {

val CLASS_HAS_API: RuleKey<Boolean> = SimpleRuleKey(
"generic.class.has.api", BooleanRule::class,
"generic.class.has.api",
BooleanRuleMode.ANY
)

val HTTP_PATH: RuleKey<String> = SimpleRuleKey(
"generic.path", StringRule::class,
"generic.path",
StringRuleMode.SINGLE
)

val HTTP_METHOD: RuleKey<String> = SimpleRuleKey(
"generic.http.method", StringRule::class,
"generic.http.method",
StringRuleMode.SINGLE
)

val METHOD_HAS_API: RuleKey<Boolean> = SimpleRuleKey(
"generic.method.has.api", BooleanRule::class,
"generic.method.has.api",
BooleanRuleMode.ANY
)

val PARAM_AS_JSON_BODY: RuleKey<Boolean> = SimpleRuleKey(
"generic.param.as.json.body", BooleanRule::class,
"generic.param.as.json.body",
BooleanRuleMode.ANY
)

val PARAM_AS_FORM_BODY: RuleKey<Boolean> = SimpleRuleKey(
"generic.param.as.form.body", BooleanRule::class,
"generic.param.as.form.body",
BooleanRuleMode.ANY
)

val PARAM_AS_PATH_VAR: RuleKey<Boolean> = SimpleRuleKey(
"generic.param.as.path.var", BooleanRule::class,
"generic.param.as.path.var",
BooleanRuleMode.ANY
)

val PARAM_PATH_VAR: RuleKey<String> = SimpleRuleKey(
"generic.param.path.var", StringRule::class,
"generic.param.path.var",
StringRuleMode.SINGLE
)

val PARAM_AS_COOKIE: RuleKey<Boolean> = SimpleRuleKey(
"generic.param.as.cookie", BooleanRule::class,
"generic.param.as.cookie",
BooleanRuleMode.ANY
)

val PARAM_COOKIE: RuleKey<String> = SimpleRuleKey(
"generic.param.cookie", StringRule::class,
"generic.param.cookie",
StringRuleMode.SINGLE
)

val PARAM_COOKIE_VALUE: RuleKey<String> = SimpleRuleKey(
"generic.param.cookie.value", StringRule::class,
"generic.param.cookie.value",
StringRuleMode.SINGLE
)

val PARAM_HEADER: RuleKey<String> = SimpleRuleKey(
"generic.param.header", StringRule::class,
"generic.param.header",
StringRuleMode.SINGLE
)

val PARAM_NAME: RuleKey<String> = SimpleRuleKey(
"generic.param.name", StringRule::class,
"generic.param.name",
StringRuleMode.SINGLE
)

Expand Down
Loading