* Migrate tests in detekt-rules-errorprone to junit
* change names of classes and function that may be a problem on windows
* WIP: remove test class that is causing issues
* re-add IgnoredReturnValueSpec.kt
* Fix merge
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
A regexp object is compiled into an internal data structure during initialization.
This could to a potential performance impact, if the `Regex()` constructor is called multiple times for the same pattern.
Since the private function `truncatedMessage()` could be called a lot, this PR fixes this potential performance issue.
Because of the overhead of object instantiation and regular expression compilation, reusing the initialized object is the recommended way.
* Changes FindingsReporter detail level
Achieved different levels of detailing by changing the format in the
implementation of compact() method for CodeSmell and
ThresholdedCodeSmell.
* Updates docs with reporting changes
* Adapts tests to findings reporter changes
* Creates extension method for console report
Reverts changes to `CodeSmell::compact` method to keep other reports
untouched.
* Truncates long messages for console reports
Prevents line breaks and long messages from breaking report structure
* Implement FullQualifiedNameGuesser
* Remove bad test
* Refactor tests
* Fix AnnotationExcluder
* More exhaustive list of default import classes
* Handle PR comments
* Suppress version warnings
Disables these warnings:
* Experimental language version being used (e.g. Kotlin compiler is 1.6,
but language version 1.7 was specified)
* Deprecated or unsupported lanuage/API version is used (e.g. Kotlin
compiler is 1.6, deprecated language version 1.4 is specified)
* Misconfiguration of `-progressive` flag, which only makes sense if latest
supported language version is being used
https://github.com/JetBrains/kotlin/blob/v1.6.10/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt#L562-L568
* Re-enable failure when compiler warnings found
Applies to all modules except detekt-gradle-plugin, see
https://github.com/detekt/detekt/pull/3835
* Don't manually specify language version
This should instead automatically track the language version used by the
compiler, as source compatibility is not a requirement for detekt.
This also avoids potential misconfiguration that will no longer be
identified by use of `-Xsuppress-version-warnings`.
* Fix warnings
* migrate tests in detekt-api to junit
* remove spek from build dependencies
* change class names that are invalid on windows
* fix HasPlatformType violation
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
* migrate tests in detekt-report-html to junit
* migrate tests in detekt-report-txt to junit
* migrate tests in detekt-report-sarif to junit
* migrate tests in detekt-report-xml to junit
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
* migrate tests in detekt-metrics to junit
* fix compiler warning about possible problems on windows
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
* Fix false positive of UnncessaryInnerClass
* Exclude Nested annotation because junit test requires @Nested test class to be inner
* Fix test code snippet
* Introduce DefaultValue type
* reuse createDefaultValueIfLiteral in RuleSetProviderCollector.kt
* use DefaultValue.of() explicitly
* default getAsPlainString to toString
* rename ListDefault to StringListDefault
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
* Use consistent JUnit version in all project configurations
* Remove explicit junit-params dependency
This is already added as a dependency by useJunitJupiter()
* Remove unused Spek dependencies from projects migrated to JUnit
* transform tests to junit
* Ignore ClassNaming rule for test classes
* Fix UnnecessaryLet violation
* rename all test classes back to xxxSpec
* remove internal modifier from test class
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
* Upgrade AGP to 7.0.4
* Run Android tests on JDK 11 and above only
* Skip Android report merging test if Android requirements unmet
* Update skip reason
Co-authored-by: Matthew Haughton <3flex@users.noreply.github.com>
* Setup JUnit 5
* Migrate custom-checks tests to JUnit
* Set the default JUnit 5 test instance lifecycle mode to "per_class"
* Use extension instead of base class to inject KotlinCoreEnvironment
Co-authored-by: marschwar <marschwar@users.noreply.github.com>
* Update contributor guidelines to reflect usage of JUnit 5
* Fix style issues
* Update detekt-test-utils API definition
* Update .github/CONTRIBUTING.md
Co-authored-by: marschwar <marschwar@users.noreply.github.com>
Co-authored-by: Chao Zhang <zhangchao6865@gmail.com>