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

Develop #46

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
69cb208
fix ComponentPositionDetector + refactor
just-d-aa Jan 13, 2021
5b67751
rewriting SpaceMethodDetector
just-d-aa Jan 13, 2021
a179a7a
correct comments
just-d-aa Jan 17, 2021
cb64c45
refactoring
just-d-aa Jan 18, 2021
b856cc2
Merge remote-tracking branch 'origin/develop' into develop
just-d-aa Jan 18, 2021
b3b6eca
fix space detector
just-d-aa Jan 18, 2021
fc8ffc9
add fixes
just-d-aa Feb 16, 2021
83eb292
fix Abbreviation Detector
just-d-aa Feb 16, 2021
5adf4e6
change MaxMethodCountDetector report message
just-d-aa Feb 16, 2021
195f354
add app files
just-d-aa Feb 16, 2021
99a088b
underscore_check_added
Apr 13, 2022
71037ca
Merge pull request #51 from Omega-R/feature/undersore_fix
anton-knyazev Apr 13, 2022
a414dae
data class check added
Apr 14, 2022
68dba4a
regex updated
Apr 14, 2022
d279b47
Merge pull request #53 from Omega-R/feature/companion_object_fix
anton-knyazev Apr 14, 2022
b30e0f6
Merge pull request #52 from Omega-R/feature/data_class_fix
anton-knyazev Apr 14, 2022
5b1feb1
format field added
Apr 14, 2022
bfd2df4
Merge pull request #54 from Omega-R/feature/string_resource_fix
anton-knyazev Apr 14, 2022
b74aff5
mask field added
Apr 15, 2022
f44a0b3
Merge pull request #55 from Omega-R/feature/string_resource_fix
anton-knyazev Apr 15, 2022
4182646
field get set method excluded
Apr 19, 2022
617c83a
lexical changes
Apr 19, 2022
e87b900
Merge pull request #56 from Omega-R/feature/get_set_fix
anton-knyazev Apr 19, 2022
bac80f0
colon added
Apr 20, 2022
efb4d09
Merge pull request #57 from Omega-R/feature/abbreviaton_fix
anton-knyazev Apr 20, 2022
0eaac49
file order detection and refactoring
Apr 26, 2022
db3d3b6
Merge pull request #58 from Omega-R/feature/order_fix
anton-knyazev Apr 26, 2022
8cb69dd
extensions recognition included
Sep 12, 2022
3cb5250
code refactored
Sep 12, 2022
368c534
Merge pull request #60 from Omega-R/feature/abbreviaton_fix
anton-knyazev Sep 12, 2022
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
10 changes: 10 additions & 0 deletions .idea/markdown-navigator-enh.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions .idea/markdown-navigator.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

148 changes: 98 additions & 50 deletions app/src/main/java/com/example/lint/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,89 +1,137 @@
package com.example.lint

import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView


class MainActivity : AppCompatActivity() {

companion object {
private val someaaa = "photo11111111111111111111111111111111111111111111111111111111111"

const val SS_S_SFDAS = 2
companion object {

val some = 2
const val ASAS = 2 * 1

private const val EXTRA_PHOTO = "photo"
val some = 2

fun createIntent(context: Context, photo: String): Intent {
return Intent(context, MainActivity ::class.java).putExtra(EXTRA_PHOTO, photo)
}
fun someFunction() {}
private val FREQUENCIES = listOf(50, 60)

fun createLauncher() = { someFunction() }
}
private const val EXTRA_PHOTO =
"photo1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"

val SSs = 2
fun ppp() {
String.toString()?.toString()
}

fun spme() {
String?.toString()
}

}

override fun onCreate(savedInstanceState: Bundle?) {

super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
fun someFunction() {

}

val cTX: Context = this
String
.toString()
fun some(): Int = 1

val s = 2

val list = listOf<String>()
fun createIntent(context: Context, photo: String): Intent = Intent()

list.forEach { line ->
val s = line
}
}
fun spme() {
String.toString()
val tag = emptyList<String>()
tag.forEach {
Log.d("some", it)
}

private fun SSsome ( ) {
MainActivity .createIntent(this, "")
}

class SomeClass() {
val soURL = 2
}
}

override fun onCreate(savedInstanceState: Bundle?) {

fun emptyFun(): Int {
try {
val s = 2
} catch (e: Exception) {
throw e
}
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)


return when(1) {
1 -> 2
else -> 0
}
val cTX: Context = this

}
var croppingBlock: (() -> Int)? = null

protected val s2: String = ""
try {

} catch (e: Exception) {
val some = 2
}

fun Get() {
val s = 2
s.toString()
//nothing
}
val list = listOf<String>()

fun aAA() {
list.forEach { line ->
val s = line
}
}

}
private fun asome() {
createIntent(this, "")
emptyURL({ val s = 2 }, { val s = 2 })
}

private fun emptyURL(function: () -> Unit, function2: () -> Unit) {
//nothing
}

@SuppressLint("OMEGA_ABBREVIATION_AS_WORD")
val soURL = 2

class SomeClass() {

}


fun em(): Int {
try {
val s = 2
} catch (e: Exception) {
throw e
}

return when (1) {
1 -> 2
else -> 0
}

}

protected val s2: String = ""


fun agset() {
val s = 2
s.toString()
//nothing
}

fun aAa() {
//nothing
}

data class GeneralSettings(
var doorStatus: Int = 1,
var keepDoorOpen: Boolean = false,
var keepDoorOpenSip: Boolean = false,
var doorOpenDuration: Int = 5,
var callDuration: Int = 5,
var talkDuration: Int = 5,
var conciergeApartment: Int = 100,
val conciergeApartment1: Int = 100,
var conciergeApartment2: Int = 100,
val conciergeApartment3: Int = 100,
var conciergeApartment5: Int = 100
)

class BasePresenter<VIEW: RecyclerView>
}
8 changes: 7 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
tools:context=".MainActivity">

<TextView
android:id="@+id/text_some"
android:id="@+id/text_save"
style="@style/Theme.AppCompat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -21,6 +21,7 @@
tools:visibility="visible" />

<TextView
android:id="@+id/text_soem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
Expand All @@ -35,4 +36,9 @@
android:textStyle="normal"
tools:ignore="MissingConstraints" />

<TimePicker
android:id="@+id/time_picker_some"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>
37 changes: 20 additions & 17 deletions checks/src/main/java/com/omegar/lint/checks/LintIssueRegistry.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.elements_for
import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.name.`class`.NameFileSufixDetector
import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.name.abbreviation.AbbreviationDetector
import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.name.field.CompanionObjectFieldsDetector
import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.order.file_class_interface.ComponentPositionDetector
import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.order.function_params.PositionArgumentDetector
import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.order.class_interface.ComponentPositionDetector
import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.order.file_package.PackageComponentDetector
import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.order.function_params.ArgumentPositionDetector
import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.restrictions.class_length.MaxClassLengthDetector
import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.restrictions.class_methods_count.MaxMethodCountDetector
import com.omegar.lint.checks.detector.code_guidelines.kotlin_style.restrictions.classes_in_package_count.MaxClassInPackageDetector
Expand All @@ -31,36 +32,38 @@ import com.omegar.lint.checks.detector.code_guidelines.xml_style.name_resource.t
import com.omegar.lint.checks.detector.project_guidelines.file_name.`class`.NameFileUpperCamelCaseDetector
import com.omegar.lint.checks.detector.project_guidelines.file_name.resource.layout.NameResourceLayoutDetector

@Suppress("UnstableApiUsage")
class LintIssueRegistry : IssueRegistry() {
override val issues: List<Issue>
get() = listOf(
NameFileUpperCamelCaseDetector.ISSUE,
AbbreviationDetector.ISSUE, // TODO need testing
PositionArgumentDetector.ISSUE,
MaxFunctionsArgumentsDetector.ISSUE,
AbbreviationDetector.ISSUE, // TODO need rewriting & lint quick fix
ArgumentPositionDetector.ISSUE, // TODO add lint quick fix
MaxFunctionsArgumentsDetector.ISSUE, // TODO ??lint quick fix??
ExceptionCatchDetector.ISSUE,
ComponentPositionDetector.ISSUE,
ComponentPositionDetector.ISSUE, //TODO add lint quick fix for
PackageComponentDetector.ISSUE,
NameIdentifierXmlDetector.ISSUE,
NameResourceStringXmlDetector.ISSUE,
NameResourceStyleXmlDetector.ISSUE,
MaxMethodCountDetector.ISSUE,
EmptyBodyFunctionDetector.ISSUE,
NameResourceStyleXmlDetector.ISSUE, //TODO change lint quick fix for
MaxMethodCountDetector.ISSUE, // TODO ??lint quick fix??
EmptyBodyFunctionDetector.ISSUE, //TODO add lint quick fix for
CompanionObjectFieldsDetector.ISSUE,
MaxFunctionLengthDetector.ISSUE,
MaxClassLengthDetector.ISSUE,
MaxFunctionLengthDetector.ISSUE, // TODO ??lint quick fix??
MaxClassLengthDetector.ISSUE, // TODO ??lint quick fix??
SimplificationsFunctionDetector.ISSUE,
MaxLineLengthDetector.ISSUE,
MaxLineLengthDetector.ISSUE, // TODO ??lint quick fix??
AnnotationDetector.ISSUE,
SpaceMethodDetector.ISSUE,
NameFileSufixDetector.ISSUE,
AttributesPositionXmlDetector.ISSUE,
MaxClassInPackageDetector.ISSUE, // TODO need testing
MaxPackageCountDetector.ISSUE, // TODO need testing
SimplificationsControlInstructionsDetector.ISSUE, // TODO need testing
MaxClassInPackageDetector.ISSUE, // TODO ??lint quick fix??
MaxPackageCountDetector.ISSUE, // TODO ??lint quick fix??
SimplificationsControlInstructionsDetector.ISSUE, //TODO add lint quick fix for
IntentExtraParametersDetector.ISSUE,
ArgumentsBundleKeyPrefixDetector.ISSUE,
LambdaDetector.ISSUE,
NameResourceLayoutDetector.ISSUE
LambdaDetector.ISSUE, //TODO add lint quick fix for
NameResourceLayoutDetector.ISSUE //TODO add lint quick fix for
)

override val api: Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ExceptionCatchDetector : Detector(), Detector.UastScanner {
context.report(
ISSUE,
body,
context.getLocation(it as UElement),
context.getLocation(body),
GENERALIZED_EXCEPTION_MESSAGE,
createEmptyBodyFix()
)
Expand Down
Loading