mirror of
https://github.com/FossifyOrg/Camera.git
synced 2025-12-23 23:59:51 -05:00
chore: ignore extra translations and update detekt rules
* chore: ignore extra translations in lint Extra translations are removed automatically by Weblate * chore: update detekt rules More compose-friendly * chore: update lint baselines
This commit is contained in:
@@ -129,6 +129,9 @@ android {
|
||||
|
||||
detekt {
|
||||
baseline = file("detekt-baseline.xml")
|
||||
config.setFrom("$rootDir/detekt.yml")
|
||||
buildUponDefaultConfig = true
|
||||
allRules = false
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -138,4 +141,5 @@ dependencies {
|
||||
implementation(libs.androidx.exifinterface)
|
||||
implementation(libs.androidx.lifecycle.runtime.ktx)
|
||||
implementation(libs.androidx.window)
|
||||
detektPlugins(libs.compose.detekt)
|
||||
}
|
||||
|
||||
@@ -11,13 +11,8 @@
|
||||
<ID>ImplicitDefaultLocale:MySize.kt$MySize$String.format("%.1f", (width * height.toFloat()) / ONE_MEGA_PIXEL)</ID>
|
||||
<ID>ImplicitDefaultLocale:VideoQuality.kt$VideoQuality$String.format("%.1f", (width * height.toFloat()) / ONE_MEGA_PIXEL)</ID>
|
||||
<ID>LargeClass:MainActivity.kt$MainActivity : SimpleActivityMediaSavedListenerCameraXPreviewListener</ID>
|
||||
<ID>LongMethod:ImageSaver.kt$ImageSaver$@SuppressLint("RestrictedApi") private fun saveImageToTempFile(): File?</ID>
|
||||
<ID>LongMethod:PhotoProcessor.kt$PhotoProcessor$override fun doInBackground(vararg params: ByteArray): String</ID>
|
||||
<ID>LongMethod:ShadowDrawable.kt$ShadowDrawable$override fun draw(canvas: Canvas)</ID>
|
||||
<ID>LongParameterList:CameraXInitializer.kt$CameraXInitializer$( previewView: PreviewView, listener: CameraXPreviewListener, mediaSoundHelper: MediaSoundHelper, outputUri: Uri?, isThirdPartyIntent: Boolean, initInPhotoMode: Boolean, )</ID>
|
||||
<ID>LongParameterList:CameraXPreview.kt$CameraXPreview$( private val activity: BaseSimpleActivity, private val previewView: PreviewView, private val mediaSoundHelper: MediaSoundHelper, private val mediaOutputHelper: MediaOutputHelper, private val cameraErrorHandler: CameraErrorHandler, private val listener: CameraXPreviewListener, private val isThirdPartyIntent: Boolean, initInPhotoMode: Boolean, )</ID>
|
||||
<ID>LongParameterList:ImageSaver.kt$ImageSaver$( private val contentResolver: ContentResolver, private val image: ImageProxy, private val mediaOutput: MediaOutput.ImageCaptureOutput, private val metadata: Metadata, private val jpegQuality: Int, private val saveExifAttributes: Boolean, private val onImageSaved: (Uri) -> Unit, private val onError: (ImageCaptureException) -> Unit, )</ID>
|
||||
<ID>LongParameterList:ImageSaver.kt$ImageSaver.Companion$( contentResolver: ContentResolver, image: ImageProxy, mediaOutput: MediaOutput.ImageCaptureOutput, metadata: Metadata, jpegQuality: Int, saveExifAttributes: Boolean, onImageSaved: (Uri) -> Unit, onError: (ImageCaptureException) -> Unit, )</ID>
|
||||
<ID>LoopWithTooManyJumpStatements:ImageQualityManager.kt$ImageQualityManager$for</ID>
|
||||
<ID>LoopWithTooManyJumpStatements:MediaActionSound.kt$MediaActionSound$for</ID>
|
||||
<ID>MagicNumber:BitmapUtils.kt$BitmapUtils$128</ID>
|
||||
@@ -33,7 +28,6 @@
|
||||
<ID>MagicNumber:FocusCircleView.kt$FocusCircleView$500L</ID>
|
||||
<ID>MagicNumber:FocusCircleView.kt$FocusCircleView$50f</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity$90</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity.<no name provided>$1000</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity.<no name provided>$134</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity.<no name provided>$225</ID>
|
||||
<ID>MagicNumber:MainActivity.kt$MainActivity.<no name provided>$289</ID>
|
||||
@@ -64,9 +58,6 @@
|
||||
<ID>MagicNumber:SettingsActivity.kt$SettingsActivity$90</ID>
|
||||
<ID>MagicNumber:SettingsActivity.kt$SettingsActivity$95</ID>
|
||||
<ID>MagicNumber:ShadowDrawable.kt$ShadowDrawable$255.0f</ID>
|
||||
<ID>MagicNumber:TimerMode.kt$TimerMode.TIMER_10$10000</ID>
|
||||
<ID>MagicNumber:TimerMode.kt$TimerMode.TIMER_3$3000</ID>
|
||||
<ID>MagicNumber:TimerMode.kt$TimerMode.TIMER_5$5000</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality$1.9f</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality$16</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality$19</ID>
|
||||
@@ -79,14 +70,6 @@
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality$6</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality$8f</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality$9f</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality.FHD$1080</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality.FHD$1920</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality.HD$1280</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality.HD$720</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality.SD$480</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality.SD$720</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality.UHD$2160</ID>
|
||||
<ID>MagicNumber:VideoQuality.kt$VideoQuality.UHD$3840</ID>
|
||||
<ID>MaxLineLength:CameraErrorHandler.kt$CameraErrorHandler$VideoRecordEvent.Finalize.ERROR_INSUFFICIENT_STORAGE -> context.toast(R.string.video_capture_insufficient_storage_error)</ID>
|
||||
<ID>MaxLineLength:ImageUtil.kt$ImageUtil$require(image.format == ImageFormat.YUV_420_888) { "Incorrect image format of the input image proxy: " + image.format }</ID>
|
||||
<ID>MaxLineLength:MainActivity.kt$MainActivity$binding.toggleCamera.setImageResource(if (frontCamera) R.drawable.ic_camera_rear_vector else R.drawable.ic_camera_front_vector)</ID>
|
||||
|
||||
@@ -58,8 +58,8 @@
|
||||
errorLine1="app-build-targetSDK = "34""
|
||||
errorLine2=" ~~~~">
|
||||
<location
|
||||
file="$HOME/work/Camera/Camera/gradle/libs.versions.toml"
|
||||
line="18"
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Camera/gradle/libs.versions.toml"
|
||||
line="19"
|
||||
column="23"/>
|
||||
</issue>
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
errorLine1="distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="$HOME/work/Camera/Camera/gradle/wrapper/gradle-wrapper.properties"
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Camera/gradle/wrapper/gradle-wrapper.properties"
|
||||
line="3"
|
||||
column="17"/>
|
||||
</issue>
|
||||
@@ -124,8 +124,8 @@
|
||||
errorLine1="gradlePlugins-agp = "8.10.1""
|
||||
errorLine2=" ~~~~~~~~">
|
||||
<location
|
||||
file="$HOME/work/Camera/Camera/gradle/libs.versions.toml"
|
||||
line="15"
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Camera/gradle/libs.versions.toml"
|
||||
line="16"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@@ -135,8 +135,8 @@
|
||||
errorLine1="androidx-ktx = "2.8.6""
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="$HOME/work/Camera/Camera/gradle/libs.versions.toml"
|
||||
line="11"
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Camera/gradle/libs.versions.toml"
|
||||
line="12"
|
||||
column="16"/>
|
||||
</issue>
|
||||
|
||||
@@ -146,8 +146,8 @@
|
||||
errorLine1="app-build-compileSDKVersion = "34""
|
||||
errorLine2=" ~~~~">
|
||||
<location
|
||||
file="$HOME/work/Camera/Camera/gradle/libs.versions.toml"
|
||||
line="17"
|
||||
file="$HOME/Projects/Fossify/FossifyOrg/Camera/gradle/libs.versions.toml"
|
||||
line="18"
|
||||
column="31"/>
|
||||
</issue>
|
||||
|
||||
|
||||
58
detekt.yml
Normal file
58
detekt.yml
Normal file
@@ -0,0 +1,58 @@
|
||||
build:
|
||||
maxIssues: 0
|
||||
weights:
|
||||
complexity: 2
|
||||
LongParameterList: 2
|
||||
style: 1
|
||||
|
||||
processors:
|
||||
active: true
|
||||
exclude:
|
||||
- "FunctionCountProcessor"
|
||||
- "PropertyCountProcessor"
|
||||
|
||||
config:
|
||||
validation: true
|
||||
|
||||
complexity:
|
||||
LongParameterList:
|
||||
active: true
|
||||
functionThreshold: 10
|
||||
constructorThreshold: 8
|
||||
ignoreDefaultParameters: true
|
||||
ignoreAnnotated:
|
||||
- "Composable"
|
||||
LongMethod:
|
||||
active: true
|
||||
threshold: 120
|
||||
ignoreAnnotated:
|
||||
- "Composable"
|
||||
- "Preview"
|
||||
|
||||
style:
|
||||
MagicNumber:
|
||||
active: true
|
||||
ignoreAnnotated: ["Composable"]
|
||||
ignoreEnums: true
|
||||
ignoreNumbers: ["-1", "0", "1", "2", "42", "1000"]
|
||||
MaxLineLength:
|
||||
active: true
|
||||
maxLineLength: 120
|
||||
excludePackageStatements: true
|
||||
excludeImportStatements: true
|
||||
|
||||
naming:
|
||||
FunctionNaming:
|
||||
active: true
|
||||
ignoreAnnotated: ["Composable", "Preview"]
|
||||
functionPattern: "[a-z][A-Za-z0-9]*"
|
||||
|
||||
Compose: # io.nlopez.compose.rules
|
||||
ComposableParametersOrdering:
|
||||
active: true
|
||||
ModifierDefaultValue:
|
||||
active: true
|
||||
MissingModifierDefaultValue:
|
||||
active: true
|
||||
PublicComposablePreview:
|
||||
active: true
|
||||
@@ -3,6 +3,7 @@
|
||||
kotlin = "2.2.0"
|
||||
#Detekt
|
||||
detekt = "1.23.8"
|
||||
detektCompose = "0.4.22"
|
||||
#Androidx
|
||||
androidx-document-file = "1.1.0"
|
||||
androidx-exif-interface = "1.4.1"
|
||||
@@ -31,6 +32,8 @@ androidx-window = { module = "androidx.window:window", version.ref = "androidx-w
|
||||
androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-ktx" }
|
||||
androidx-exifinterface = { module = "androidx.exifinterface:exifinterface", version.ref = "androidx-exif-interface" }
|
||||
androidx-documentfile = { module = "androidx.documentfile:documentfile", version.ref = "androidx-document-file" }
|
||||
#Compose
|
||||
compose-detekt = { module = "io.nlopez.compose.rules:detekt", version.ref = "detektCompose" }
|
||||
#Fossify
|
||||
fossify-commons = { module = "org.fossify:commons", version.ref = "commons" }
|
||||
[bundles]
|
||||
|
||||
Reference in New Issue
Block a user