woltapp / arrow-detekt-rules Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
"it's" is a contraction of "it is" or "it has", while "its" is the possessive form of "it"
Sorry to be pedantic, it just sort of a bugged me, but seemed too small for a full PR.
Hey, just wanted to give you a heads up in case you didn't know. You can add your ruleset to https://detekt.dev/marketplace.
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") }
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.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.