* Simplify AnnotationExcluderSpec
* Improve tests
* Improve tests
* Fix FullQualifiedNameGuesser
* Allow List<Regex> inside AnnotationExcluder to give more options to the callers
* Test with and without type-solving
* Make AnnotationExcluder use the BindingContext when available
* AnnotationSuppressor works with Full Qualified names without type solving
* Address PR comments
* Update detekt-psi-utils/src/test/kotlin/io/github/detekt/psi/internal/FullQualifiedNameGuesserSpec.kt
Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com>
* Support star imports
* Improve readability
Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com>
* Better error classification in Gradle Enterprise.
Use `Lint failed` instead of `Build failed` in exception
Fixes#4585
* Use Analysis failed instead of Lint failed
* Fix failing test not using new artifact
* Undo change to gradle build
The ANDROID_HOME and ANDROID_SDK_ROOT environment variables are accessed
by the test suite. They need to be registered as task inputs so Gradle's
up-to-date checks work correctly when the environment variable values
change.
* 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