Git Product home page Git Product logo

arrow-detekt-rules's People

Contributors

actions-user avatar dependabot[bot] avatar diastremskii avatar nomisrev 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

Watchers

 avatar  avatar

arrow-detekt-rules's Issues

Property 'ArrowRuleSet' is misspelled or does not exist.

When I followed the readme to try to enable this plugin, I got this error:

Property 'ArrowRuleSet' is misspelled or does not exist.

The following content is added to my detekt configuration file (detekt-config-overrides.yml):

ArrowRuleSet:
     NoEffectScopeBindableValueAsStatement:
           active: true

ArrowRuleSet a top most option (without any space ahead). The configuration file is used like this:

detekt {
    toolVersion = detektVersion
    autoCorrect = true
    buildUponDefaultConfig = true
    config.from("$rootDir/gradle/detekt-config-overrides.yml")
}

Added rule, but breach was not detected

I included the plugin

subprojects {
  apply(plugin = "io.gitlab.arturbosch.detekt")
  apply(plugin = "java")
  apply(plugin = "kotlin")

  detekt {
    toolVersion = "1.22.0"
    config = files("${rootDir}/.detekt.yml")
    buildUponDefaultConfig = true
  }

  dependencies {
    detektPlugins("com.wolt.arrow.detekt:rules:0.1.0")
  }

...

configured it:

ArrowRuleSet:
  NoEffectScopeBindableValueAsStatement:
    active: true

Tried to force an error

either {
  eitherOne() // .bind()
  eitherTwo().bind()
  eitherThree().bind()
}

Ran gradle detekt.

It was successful where I expected it to fail.

I know that the configuration of the plugin is correct because if I move the ArrowRuleSet declaration to some other scope in the detekt config it will throw a parse error.

Rule to detect not handled Left which is not wrapped into either {}

Let say I have a function:

fun doSomething(): Either<CustomError, Unit> = ...

and

fun doWithoutEither() {
    doSomething()
}

What do you think about adding a rule which will detect functions which return Either<Left, Right> but are called not inside either{} or their left side is not handled?

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.