Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@arturbosch
Copy link
Member

@arturbosch arturbosch commented Jul 13, 2020

This significantly improves build and test times.

I think we now have a perfectly parallel build xD

2020-07-13-144610_1686x320_scrot

}

private fun Config.valueOrDefaultCommaSeparated(
fun Config.valueOrDefaultCommaSeparated(
Copy link
Member Author

@arturbosch arturbosch Jul 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was a duplicate in detekt-rules.
We use this api/internal implementation now in the rule sets.

Imo we should later make this function part of the public api as we want to support yaml lists.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ€” do we want to encorage the support of yaml lists AND comma separated strings? I don't think so, I mean, I think that it's better to only support yaml lists.

This significantly improves build and test times.
@arturbosch
Copy link
Member Author

        Caused by:
        java.lang.IllegalArgumentException: Kotlin script engine not supported
            at io.github.detekt.test.utils.KotlinScriptEnginePool.createEngine(KotlinScriptEnginePool.kt:37)
            ... 10 more

sounds like a missing dependecy?

@codecov
Copy link

codecov bot commented Jul 13, 2020

Codecov Report

Merging #2865 into master will increase coverage by 0.11%.
The diff coverage is 98.85%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2865      +/-   ##
============================================
+ Coverage     80.66%   80.78%   +0.11%     
- Complexity     2343     2346       +3     
============================================
  Files           388      388              
  Lines          7035     7050      +15     
  Branches       1288     1288              
============================================
+ Hits           5675     5695      +20     
+ Misses          716      709       -7     
- Partials        644      646       +2     
Impacted Files Coverage Ξ” Complexity Ξ”
...tlab/arturbosch/detekt/api/internal/PathFilters.kt 92.00% <ΓΈ> (+8.00%) 4.00 <0.00> (ΓΈ)
...rbosch/detekt/rules/AllowedExceptionNamePattern.kt 0.00% <ΓΈ> (ΓΈ) 0.00 <0.00> (?)
.../io/gitlab/arturbosch/detekt/rules/GuardClauses.kt 87.50% <ΓΈ> (ΓΈ) 0.00 <0.00> (?)
...o/gitlab/arturbosch/detekt/rules/IdentifierName.kt 0.00% <0.00%> (ΓΈ) 0.00 <0.00> (?)
...io/gitlab/arturbosch/detekt/rules/IsPartOfUtils.kt 100.00% <ΓΈ> (ΓΈ) 0.00 <0.00> (?)
...b/arturbosch/detekt/rules/KtAnnotatedExtensions.kt 80.00% <ΓΈ> (ΓΈ) 0.00 <0.00> (?)
...turbosch/detekt/rules/KtClassOrObjectExtensions.kt 66.66% <ΓΈ> (ΓΈ) 0.00 <0.00> (?)
...o/gitlab/arturbosch/detekt/rules/KtModifierList.kt 100.00% <ΓΈ> (ΓΈ) 0.00 <0.00> (?)
.../gitlab/arturbosch/detekt/rules/KtValueArgument.kt 66.66% <ΓΈ> (ΓΈ) 0.00 <0.00> (?)
.../gitlab/arturbosch/detekt/rules/MethodSignature.kt 50.00% <ΓΈ> (ΓΈ) 0.00 <0.00> (?)
... and 205 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update bf6f979...dd59415. Read the comment docs.

Comment on lines +34 to +35
val engine = KotlinJsr223JvmLocalScriptEngineFactory().scriptEngine as? KotlinJsr223JvmLocalScriptEngine
return requireNotNull(engine) { "Kotlin script engine not supported" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one!

Copy link
Member

@BraisGabin BraisGabin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘πŸ‘πŸ‘ Good one. I'm not sure it's just an idea that I had. Is it better :detekt-rules-style or :detekt-rules:style? I mean, all the rule modules as submodules of :detekt-rules

Comment on lines +2 to +3
compileOnly(project(":detekt-api"))
compileOnly(project(":detekt-metrics"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do this have sense to be here? I mean, should we try to remove these two dependencies in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api is meant to be compileOnly for rules.
The metrics one is used for lines of code. Imo it is okay, not as bad as depending on core.

UnusedPrivateMemberNegative("/UnusedPrivateMemberNegative.kt");

fun path(): Path = resourceAsPath(file)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't notice that this file is already this short! Good work everyone πŸ‘πŸ‘πŸ‘πŸ‘

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one. I'm not sure it's just an idea that I had. Is it better :detekt-rules-style or :detekt-rules:style? I mean, all the rule modules as submodules of :detekt-rules

If we would develop in a monorepo with different projects I would also favor detekt-rules:style to have a clearer project structure.
However Gradle's project.subprojects returns just the modules one level deeper. Therefore our build scripts would need to be more complex and test if a module is a "meta-module" which just groups other modules and does not need plugins like kotlin and stuff for test.

Lets keep every module top level for now.

@arturbosch arturbosch modified the milestones: 1.11.0, 1.10.1 Jul 13, 2020
@arturbosch arturbosch merged commit b6e88a9 into master Jul 13, 2020
@arturbosch arturbosch deleted the split-rules branch July 13, 2020 17:26
@cortinico
Copy link
Member

Awesome change @arturbosch πŸŽ‰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants