Code Monkey home page Code Monkey logo

nopen's People

Contributors

ghbhaha avatar jakewharton 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

nopen's Issues

Lint artifact

Open to a PR with a lint analogue of this? Benefit being that it could show up in the IDE as they're typing

nopen not respecting disableWarningInGeneratedCode errorprone setting

I am attempting to use nopen with an Android Project, but cannot seem to disable the errors in generated code. nopen is currently flagging the ButterKnife generated view bindings. My app module build.gradle is as follows:

apply plugin: 'com.android.application'
apply plugin: "net.ltgt.errorprone"

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"

    def keystorePropertiesFile = rootProject.file("keystore.properties")
    def keystoreProperties = new Properties()
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))


    defaultConfig {
        applicationId "com.nickwelna.issuemanagerforgithub"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        buildConfigField "String", "CLIENT_SECRET", keystoreProperties["CLIENT_SECRET"]
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0-beta05'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
    implementation "androidx.navigation:navigation-fragment:2.2.0-beta01"
    implementation "androidx.navigation:navigation-ui:2.2.0-beta01"
    implementation 'com.google.android.material:material:1.1.0-beta01'
    implementation 'com.google.firebase:firebase-core:17.2.0'
    implementation 'com.google.firebase:firebase-auth:19.1.0'
    implementation 'com.google.firebase:firebase-database:19.1.0'
    implementation 'com.jakewharton:butterknife:10.2.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.github.bumptech.glide:glide:4.10.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
    implementation 'com.squareup.retrofit2:retrofit:2.6.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
    implementation 'com.squareup.retrofit2:converter-moshi:2.6.2'
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
    debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.3'
    implementation 'com.google.flogger:flogger:0.4'
    implementation 'com.google.flogger:flogger-system-backend:0.4'
    implementation 'com.squareup.moshi:moshi:1.8.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'

    compileOnly 'com.jakewharton.nopen:nopen-annotations:1.0.1'
    errorprone "com.google.errorprone:error_prone_core:2.3.3"
    errorprone 'com.jakewharton.nopen:nopen-checker:1.0.1'
    errorproneJavac "com.google.errorprone:javac:9+181-r4173-1"
}

android.applicationVariants.all { variant ->
    variant.javaCompileProvider.configure {
        options.errorprone.disableWarningsInGeneratedCode = true
    }
}

apply plugin: 'com.google.gms.google-services'

And my project build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        gradlePluginPortal()
    }
    dependencies {
        classpath 'net.ltgt.gradle:gradle-errorprone-plugin:1.1.0'
        classpath 'com.android.tools.build:gradle:3.5.1'
        classpath 'com.google.gms:google-services:4.3.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Am I missing something?

How about something like Final by Default

Probably a check which checks if the class is not marked with @Open or abstract should not have any subclasses.

On a related note, it will be a great thing to have FinalByDefault (similar to NonNullByDefault) baked in the type system via EP check or checker framework.

non final methods check

hey @JakeWharton first of all thanks for the great work.

I'd love to see nopen also checking non-final methods when they should be.
I believe it makes sense to be within this lib, but this is you to say.

The idea is pretty much similar to @OPEN, but for methods.
A method should be final (when possible) or annotated.

I've made a Draft PR (more like a POC), #8 and happy to chat about.
If you are willing to bring this in and accept a PR, I'd gladly work on it.

Thanks a lot :)

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.