Giter Site home page Giter Site logo

lint-rules's Introduction

Lint-Rules

A set of very opinionated lint rules.

Android Lint Rules

compile 'com.vanniktech:lint-rules-android:0.25.0'
compile 'com.vanniktech:lint-rules-android:0.26.0-SNAPSHOT'

Full list of all checks that are added.

Kotlin Lint Rules

compile 'com.vanniktech:lint-rules-kotlin:0.25.0'
compile 'com.vanniktech:lint-rules-kotlin:0.26.0-SNAPSHOT'

Full list of all checks that are added.

RxJava 2 Lint Rules

compile 'com.vanniktech:lint-rules-rxjava2:0.25.0'
compile 'com.vanniktech:lint-rules-rxjava2:0.26.0-SNAPSHOT'

Full list of all checks that are added.

License

Copyright (C) 2017 Vanniktech - Niklas Baudy

Licensed under the Apache License, Version 2.0

lint-rules's People

Contributors

dependabot[bot] avatar dlleixap avatar okarakose avatar ppetka avatar renovate[bot] avatar tasomaniac avatar vanniktech avatar verno3632 avatar yayaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lint-rules's Issues

MatchingViewId lint fix bug

MatchingViewId lint fix just replaces the whole id with the layout name, instead of prefixing it with the layout name. All ids become the same.

Example:

Let's say I have @+id/button inside login_fragment.xml. The id becomes loginFragment, but it should become loginFragmentButton

Missing QuickFixes

  • SuperfluousNameSpaceDetector
  • XmlSpacingDetector
  • RxJava2MethodMissingCheckReturnValueDetector
  • RawDimenDetector (collect dimens and then propose up to 5 matching ones)
  • RawColorDetector (collect colors and then propose up to 5 matching ones)

When will version 0.14.0 be released?

Hi,

Thanks for the great set of lint rules, I recently migrated to Android Studio 4.1.2, and I was wondering when will version 0.14.0 be released? The last commits suggest that it should be ready for 4.1.2.

Cheers,

RxJava2MissingCompositeDisposableClearDetector missing nested PsiStatement's checks?

Hey, I have notice that in your RxJava2MissingCompositeDisposableClearDetector class you check only 1st level PsiStatments in methods? Is that desired behaviour?

for example if u have Java method like

public void foo(){
   compositeDisposable.clear() //this will be found
 
   if(true){
       compositeDisposable.clear() //this wont be found 
   }else{
       compositeDisposable.clear() //this wont be found
   }
}

Check wont find occurences in nested code blocks since they are not PsiExpressions they are PsiCodeBlock's
This code example is dumb but its about to point that any nested calls wont be found.

I am begginer in developing lint-rules and I am not sure if there are other types of nested blocks that are not conditioned and should be checked.

Greetings

ErroneousLayoutAttribute fails for ConstraintLayout and layout_gravity

Using layout_gravity for a child view of FrameLayout is a valid case and ErroneousLayoutAttribute gives error.

This should not fail.

<FrameLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"/>
</FrameLayout>

Attribute check uses endsWith method here https://github.com/vanniktech/lint-rules/blob/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/ErroneousLayoutAttributeDetector.kt#L60.
That also include layout_gravity for gravity attribute.

Integration of Lint Rules Resulting in NamingPattern Error

We recently integrated lint rules for the test module, and suddenly, we began encountering a NamingPattern lint error.

The convention we adhere to for tests is outlined here: https://kotlinlang.org/docs/coding-conventions.html#names-for-test-methods

Our tests typically resemble the following format:

 @Test
 fun `WHEN scenario, THEN should give expected`() { }

Here is how the lint error appears:

Explanation for issues of type "NamingPattern":
Sometimes, there is more than one reasonable way to convert an English phrase into camel case, especially when acronyms or unconventional constructs like "IPv6" or "iOS" are involved. For example, XML HTTP request becomes XmlHttpRequest. However, XMLHTTPRequest would be incorrect.

Add support for lintChecks gradle dependency configuration

Thanks for the great tool. I can use if i include the dependency using implementation. However if i use lintChecks, running lint gives the following error

You can reproduce using by cloning sample project https://github.com/ktanna/TestLintRules, and running ./gradlew :app:lint

> Lint infrastructure error
  Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.android.tools.lint.gradle.api.ReflectiveLintRunner.runLint(ReflectiveLintRunner.kt:38)
        at com.android.build.gradle.tasks.LintBaseTask.runLint(LintBaseTask.java:114)
        at com.android.build.gradle.tasks.LintGlobalTask.lint(LintGlobalTask.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:717)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:684)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:476)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:461)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:444)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:93)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:237)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
        at java.util.Optional.orElseGet(Optional.java:267)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
        at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31)
        at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:208)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
        at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43)
        at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
        at java.util.Optional.map(Optional.java:215)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:69)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:47)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:140)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
        at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
        at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
        at java.lang.Thread.run(Thread.java:748)
  Caused by: java.lang.IllegalStateException: manifest must not be null
        at com.android.tools.lint.client.api.JarFileIssueRegistry$Factory.findRegistries(JarFileIssueRegistry.kt:308)
        at com.android.tools.lint.client.api.JarFileIssueRegistry$Factory.get(JarFileIssueRegistry.kt:101)
        at com.android.tools.lint.client.api.LintDriver.registerCustomDetectors(LintDriver.kt:470)
        at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.kt:390)
        at com.android.tools.lint.LintCliClient.run(LintCliClient.java:238)
        at com.android.tools.lint.gradle.LintGradleClient.run(LintGradleClient.java:261)
        at com.android.tools.lint.gradle.LintGradleExecution.runLint(LintGradleExecution.java:305)
        at com.android.tools.lint.gradle.LintGradleExecution.lintAllVariants(LintGradleExecution.java:426)
        at com.android.tools.lint.gradle.LintGradleExecution.analyze(LintGradleExecution.java:99)
        ... 104 more
  

WrongAnnotationOrder change order for @Override annotation

Hi @vanniktech,

I recently ran all the lints against my project, one of the lints, WrongAnnotationOrder, changes the default order for @Override

I recommend a change, to ensure that @Override is always first, and not to change the order of @Override if it is first

Example (desired order):

@SuppressWarnings("MagicCharacter")
@NonNull
@Override
public String toString() {}

RxJava2MethodMissingCheckReturnValue on private functions

I found RxJava2MethodMissingCheckReturnValue very valuable. Thanks for that.

But not so much when it comes to private functions. Often times I extract some of the RxJava chains just to have better names etc. Then I feel like it is too much to put CheckReturnValue everywhere. I would just put them on the public API.

What is your opinion on this?

I wonder if it is possible to make lint checks configurable? I guess not atm.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v3
  • gradle/wrapper-validation-action v1
  • gradle/gradle-build-action v2
  • actions/setup-java v3
.github/workflows/publish-release.yml
  • actions/checkout v3
  • actions/setup-java v3
  • gradle/gradle-build-action v2
.github/workflows/publish-snapshot.yml
  • actions/checkout v3
  • actions/setup-java v3
  • gradle/gradle-build-action v2
gradle
gradle.properties
settings.gradle.kts
build.gradle.kts
gradle/libs.versions.toml
  • junit:junit 4.13.2
  • com.android.tools.lint:lint-api 30.3.1
  • com.android.tools.lint:lint 30.3.1
  • com.android.tools.lint:lint-tests 30.3.1
  • com.android.tools.build:gradle 7.3.1
  • com.vanniktech:gradle-maven-publish-plugin 0.22.0
  • org.jetbrains.kotlin:kotlin-gradle-plugin 1.6.21
  • org.jetbrains.dokka:dokka-gradle-plugin 1.7.20
  • com.vanniktech.code.quality.tools 0.22.0
lint-rules-android/gradle.properties
lint-rules-android/build.gradle.kts
lint-rules-android-lint/gradle.properties
lint-rules-android-lint/build.gradle.kts
lint-rules-kotlin/gradle.properties
lint-rules-kotlin/build.gradle.kts
lint-rules-kotlin-lint/gradle.properties
lint-rules-kotlin-lint/build.gradle.kts
lint-rules-rxjava2/gradle.properties
lint-rules-rxjava2/build.gradle.kts
lint-rules-rxjava2-lint/gradle.properties
lint-rules-rxjava2-lint/build.gradle.kts
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 7.5.1

  • Check this box to trigger a request for Renovate to run again on this repository

WrongAnnotationError problem with Custom annotations

When custom annotations are present, WrongAnnotationError expects custom ones to be at the end. It can be seen here that it expects Inject to be before any custom annotation: https://github.com/vanniktech/lint-rules/blob/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AnnotationOrderDetectorTest.kt#L349

This particular instance works well. But it is a problem when used with Kotlin. Kotlin puts Nullable, NonNull annotations automatically. That means when used together with custom annotation, it will always result in an error.

The following instance for example:

@BindingAdapter("toolbarSubtitle")
fun Toolbar.setToolbarSubtitle(text: String?) {
    text?.let {
        subtitle = text
    }
}

There is no way to fix the given warning since there is only a single annotation.

I was gonna open a PR by just ignoring custom annotations. It is a small change in the code and fixes the issue. But then the given test above was breaking.

What do you think? Should I do that?

WrongAnnotationError lintFix problem

The code I had has JvmStatic and Provides in wrong order. But while running lintFix, I had the following error.

I'm on Android Tools 3.3

  Caused by: java.lang.IllegalArgumentException: Did not find "@Provides @JvmStatic @NotNull" in "@Provides
      @JvmStatic
      internal fun provideRequests(retrofit: Retrofit) = retrofit.create<AuthenticationRequests>()" as suggested in the quickfix. Consider calling ReplaceStringBuilder#range() to set a larger range to search than the default highlight range.
        at com.android.tools.lint.LintFixPerformer.addReplaceString(LintFixPerformer.kt:493)
        at com.android.tools.lint.LintFixPerformer.addEdits(LintFixPerformer.kt:244)
        at com.android.tools.lint.LintFixPerformer.registerFix(LintFixPerformer.kt:94)
        at com.android.tools.lint.LintFixPerformer.findApplicableFixes(LintFixPerformer.kt:209)
        at com.android.tools.lint.LintFixPerformer.fix(LintFixPerformer.kt:100)
        at com.android.tools.lint.LintCliClient.run(LintCliClient.java:258)
        at com.android.tools.lint.gradle.LintGradleClient.run(LintGradleClient.java:243)

Some rules not working in Android studio

Hi,

I just discovered this library and am sure it's something I'm doing wrong, but I cannot work out what.

Having installed the library and run a lint check it indeed found lots of issues that I dutifully went through and corrected.

However it is not picking up these two (maybe more, these are the only ones I noticed because I knew I had some of these pending correction)...

  • RawDimen - defining dimension sizes in sp or dp rather than calling @dimen/something is not picked up
  • HardCodedText - whilst not specific to this library, since adding the library the linter no longer picks up text="Hello World!" as a warning that @string/something should be used, which it used to do by default (and is still showing as enabled in the Android Studio linter settings)

Any help appreciated, if you need any more information form me please let me know.

Thanks

XmlSpacingDetector

Detects things like:

<resources>
  
  <string name="foo">bar</string>
</resources>

since it should be:

<resources>
  <string name="foo">bar</string>
</resources>

Also double new lines like:

<Layout>


  <TextView/>
</Layout>

Or now new lines between tags:

<Layout>
  <TextView/>
  <TextView/>
</Layout>

The following would be valid though:

<resources>
  <!--
  Some comment.
   -->

  <style/>
</resources>

Build error NoSuchFieldError: Companion

Hi,
first of all thank you for sharing this work.

When I try to build this project I am currently facing following error:

Could not load custom lint check jar file /home/user/projects/github/lint-rules/lint-rules-android/build/intermediates/lint/lint.jar
java.lang.NoSuchFieldError: Companion
at com.vanniktech.lintrules.android.InvalidImportDetectorKt.(InvalidImportDetector.kt:15)

at com.vanniktech.lintrules.android.IssueRegistry.getIssues(IssueRegistry.kt:18)
at com.android.tools.lint.client.api.JarFileIssueRegistry.(JarFileIssueRegistry.kt:53)
at com.android.tools.lint.client.api.JarFileIssueRegistry.(JarFileIssueRegistry.kt:45)
at com.android.tools.lint.client.api.JarFileIssueRegistry$Factory.get(JarFileIssueRegistry.kt:176)
at com.android.tools.lint.client.api.JarFileIssueRegistry$Factory.get(JarFileIssueRegistry.kt:143)
at com.android.tools.lint.client.api.LintDriver.registerCustomDetectors(LintDriver.kt:426)
at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.kt:357)
at com.android.tools.lint.LintCliClient.run(LintCliClient.java:155)
at com.android.build.gradle.internal.LintGradleClient.run(LintGradleClient.java:197)
....

I am currently working on an own library where I am getting the same error.
Do you have any explanations for that?

working environment: AndroidStudio 3.0.1

Thanks in advance.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid configuration option: ignoredDeps

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.