Skip to content

Commit 00a77a5

Browse files
committed
review: 检测部分 boolean 变量命名
1 parent b019d7e commit 00a77a5

File tree

6 files changed

+31
-15
lines changed

6 files changed

+31
-15
lines changed

art/regex.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,14 @@ ism
6767

6868
[ ]+boolean[ ]+[m]{0,1}is[A-Za-z]+
6969

70-
[ ]+boolean[ ]+[m]{0,1}[Ii]{1}s[A-Za-z]+
70+
[ ]+boolean[ ]+[m]{0,1}[Ii]{1}s[A-Za-z]+
71+
72+
[ ]+boolean[ ]+[m]{0,1}[Ii]{1}s[A-Za-z]+[ ]+=[ ]+\w+;
73+
74+
75+
// ==========
76+
// = kotlin =
77+
// ==========
78+
79+
80+
[ ]+[m]{0,1}is[A-Z]+[; =]+

lib/DevApp/src/main/java/dev/utils/app/assist/record/AppRecordInsert.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public class AppRecordInsert
2020
extends RecordInsert {
2121

2222
// 是否每次都创建新的 FileInfo
23-
private final boolean isEveryCreate;
23+
private final boolean mEveryCreate;
2424

2525
public AppRecordInsert(boolean everyCreate) {
2626
super(null);
27-
this.isEveryCreate = everyCreate;
27+
this.mEveryCreate = everyCreate;
2828
}
2929

3030
// =
@@ -36,7 +36,7 @@ public final RecordInsert setFileInfo(String fileInfo) {
3636

3737
@Override
3838
public String getFileInfo() {
39-
if (isEveryCreate) return createFileInfo();
39+
if (mEveryCreate) return createFileInfo();
4040
if (StringUtils.isNotEmpty(mFileInfo)) return mFileInfo;
4141
mFileInfo = createFileInfo();
4242
return mFileInfo;

lib/DevBase/src/main/java/dev/base/utils/assist/DevBaseContentAssist.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import dev.base.R
1717
class DevBaseContentAssist {
1818

1919
// 是否安全处理 ( 建议跟随 BuildConfig.DEBUG 取反处理, 开发阶段抛出异常 )
20-
private var isSafe = false
20+
private var mSafe = false
2121

2222
// 最外层 Layout
2323
@JvmField
@@ -100,15 +100,15 @@ class DevBaseContentAssist {
100100
* 是否安全处理
101101
*/
102102
fun isSafe(): Boolean {
103-
return isSafe
103+
return mSafe
104104
}
105105

106106
/**
107107
* 设置是否安全处理
108108
* @return [DevBaseContentAssist]
109109
*/
110110
fun setSafe(safe: Boolean): DevBaseContentAssist {
111-
isSafe = safe
111+
mSafe = safe
112112
return this
113113
}
114114

@@ -533,7 +533,7 @@ class DevBaseContentAssist {
533533
// 防止重复添加, 当 parent 不为 null 则表示已添加, 则进行移除
534534
parent?.removeView(view)
535535

536-
if (isSafe) {
536+
if (mSafe) {
537537
view?.let { viewGroup?.addView(it, index) }
538538
} else {
539539
viewGroup!!.addView(view, index)
@@ -560,7 +560,7 @@ class DevBaseContentAssist {
560560
// 防止重复添加, 当 parent 不为 null 则表示已添加, 则进行移除
561561
parent?.removeView(view)
562562

563-
if (isSafe) {
563+
if (mSafe) {
564564
view?.let { viewGroup?.addView(it, index, params) }
565565
} else {
566566
viewGroup!!.addView(view, index, params)

lib/DevEngine/src/main/java/dev/engine/compress/CompressConfig.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ class CompressConfig @JvmOverloads constructor(
1414
) : ICompressEngine.EngineConfig() {
1515

1616
// 压缩失败、异常是否结束压缩
17-
var isFailFinish = false
18-
private set
17+
private var mFailFinish = false
1918

2019
constructor(targetDir: String?) : this(100, true, targetDir)
2120

@@ -24,8 +23,14 @@ class CompressConfig @JvmOverloads constructor(
2423
targetDir: String?
2524
) : this(ignoreSize, true, targetDir)
2625

26+
// =
27+
28+
fun isFailFinish(): Boolean {
29+
return mFailFinish
30+
}
31+
2732
fun setFailFinish(failFinish: Boolean): CompressConfig {
28-
isFailFinish = failFinish
33+
mFailFinish = failFinish
2934
return this
3035
}
3136
}

lib/DevEngine/src/main/java/dev/engine/compress/engine_luban.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class LubanEngineImpl : ICompressEngine<CompressConfig> {
6262
return LubanUtils.compress(
6363
lists, LubanUtils.Config(
6464
config.ignoreSize, config.focusAlpha, config.targetDir
65-
).setFailFinish(config.isFailFinish), predicate, rename,
65+
).setFailFinish(config.isFailFinish()), predicate, rename,
6666
object : LubanUtils.OnCompressListener {
6767
override fun onStart(
6868
index: Int,

lib/LocalModules/DevOther/src/main/java/dev/receiver/WifiReceiver.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,9 @@ class WifiReceiver private constructor() : BroadcastReceiver() {
262262
// 判断是否 Wifi 打开了, 变化触发一次
263263
WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION -> {
264264
// 判断是否打开 Wifi
265-
val isOpenWifi =
266-
intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, false)
265+
val isOpenWifi = intent.getBooleanExtra(
266+
WifiManager.EXTRA_SUPPLICANT_CONNECTED, false
267+
)
267268
// 触发回调
268269
sListener?.onWifiSwitch(isOpenWifi)
269270
}

0 commit comments

Comments
 (0)