Commit Graph

4119 Commits

Author SHA1 Message Date
Nelson Osacky
cf4b7bd091 Better error classification in Gradle Enterprise. (#4586)
* 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
2022-02-19 14:51:29 -08:00
Jamie Slome
f15ce50d5e Create SECURITY.md (#4538)
* Create SECURITY.md

* Complete initial version of SECURITY.md

* Fix PR link

* Narrate our supported versions for security

* Update SECURITY.md

* Update SECURITY.md

Co-authored-by: Nicola Corti <corti.nico@gmail.com>

* Improve wording

* Update SECURITY.md

Co-authored-by: Nicola Corti <corti.nico@gmail.com>

Co-authored-by: Chao Zhang <chao.zhang@instacart.com>
Co-authored-by: Chao Zhang <zhangchao6865@gmail.com>
Co-authored-by: Nicola Corti <corti.nico@gmail.com>
2022-02-15 20:58:02 -08:00
marschwar
2aad546d74 Refactor config printer to improve testability (#4580)
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
2022-02-13 22:43:01 +01:00
marschwar
b6731edbd0 Avoid usage of java stream for parameterized tests (#4579) 2022-02-10 23:51:18 +01:00
marschwar
d50224e1b0 Split rule documentation printer to improve testability (#4578)
* split rule documentation printer to improve testability

* add tests for missed code paths

Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
2022-02-10 23:34:51 +01:00
Matthew Haughton
e0e4ae2986 Migrate detekt-rules-naming tests to JUnit (#4574) 2022-02-10 19:24:04 +00:00
Matthew Haughton
00a472812b Migrate detekt-gradle-plugin tests to JUnit (#4529)
* Migrate detekt-gradle-plugin functional tests to JUnit

* Migrate detekt-gradle-plugin tests to JUnit

* Remove unused dependencies

* Removed unused function
2022-02-10 18:34:33 +11:00
Matthew Haughton
7d87c80e24 Enable Gradle's configuration cache by default (#4576)
* Flag tasks known to be incompatible with Gradle's configuration cache

* Enable Gradle's configuration cache by default
2022-02-09 21:06:14 +11:00
Matthew Haughton
1b72d0082d Migrate detekt-rules-exceptions tests to JUnit (#4572)
* Migrate detekt-rules-exceptions tests to JUnit

* Improve nested test descriptions
2022-02-09 08:22:54 +11:00
Goooler
6734a9f852 Make VERSION_CATALOGS stable (#4577) 2022-02-09 08:20:32 +11:00
renovate[bot]
1cc61fce35 Update dependency gradle to v7.4 (#4573)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-08 23:11:02 +11:00
Matthew Haughton
7126e4ba3e Migrate detekt-rules-performance tests to JUnit (#4569) 2022-02-07 21:49:00 +01:00
Matthew Haughton
780849fc09 Migrate detekt-rules-complexity tests to JUnit (#4566) 2022-02-07 21:41:02 +01:00
Matthew Haughton
a2fd61dd44 Remove redundant shadowed val (#4571) 2022-02-07 13:10:24 +01:00
Matthew Haughton
56baa437ed Drop Groovy DSL testing in DetektTaskDslSpec (#4563)
* Drop Groovy DSL testing in DetektTaskDslSpec

* Reformat
2022-02-07 21:28:47 +11:00
Matt Thompson
dfd1966dfa update InvalidPackageDeclaration to report if rootPackage is not present (#4484) 2022-02-07 08:59:25 +00:00
Matthew Haughton
efcc0d95de Migrate detekt-rules-documentation tests to JUnit (#4568) 2022-02-07 09:38:36 +01:00
Matthew Haughton
04006ece92 Migrate detekt-rules-coroutines tests to JUnit (#4567) 2022-02-07 09:35:36 +01:00
Matthew Haughton
1e406db9bb Add missing task inputs (#4565)
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.
2022-02-06 16:34:49 +11:00
Matthew Haughton
a04debc51f Remove unneeded add-opens flag (#4564)
The original issue appears fixed in recent AGP versions
2022-02-06 16:34:39 +11:00
renovate[bot]
b21f0b9538 Update dependency com.android.tools.build:gradle to v7.1.1 (#4561)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-05 16:22:26 +00:00
Nicola Corti
557c7d3180 Fix for missing /kotlin folder when running on Android projects (#4554) 2022-02-05 10:10:35 +00:00
Nicola Corti
56f34c4cf8 Fix AutoCorrection crashing with Missing extension point (#4545) 2022-02-04 23:11:26 +00:00
Nicola Corti
da062f9f70 Deprecate continuationIndentSize from the Indentation rule (#4551) 2022-02-04 23:11:01 +00:00
renovate[bot]
ce9d5d7323 Update plugin gradleVersions to v0.42.0 (#4559)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-04 23:06:53 +00:00
Nicola Corti
f6e2d3070e Fix broken website due to invalid baseurl (#4558) 2022-02-04 15:06:41 +01:00
Goooler
f626273153 Reuse setReportOutputConventions (#4546)
* Reuse `outputLocation.convention`

* Single line

* Rename
2022-02-04 16:38:42 +11:00
Nicola Corti
35e5dc7672 Fix broken website due to missing baseurl (#4557) 2022-02-04 16:35:39 +11:00
Nicola Corti
74d3b6f1e3 Move the website to detekt.dev (#4544) 2022-02-04 00:50:26 +00:00
Raman Gupta
c854a2ec1f Make DoubleMutabilityForCollection configurable and set a DoubleMutability alias (#4541)
* Configurable double mutability rule

Resolves #4501

* Update default config

* Additional tests via factory and calculation functions

* Add property delegation double mutability negative tests

* Fix import order in dbl mutability test

* Fix code snippet compilation
2022-02-01 23:50:04 +01:00
marschwar
c34f5faec1 Migrate tests in detekt-rules-errorprone to junit (#4523)
* 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>
2022-02-01 07:24:31 +01:00
M Schalk
fb1b6041b3 Fix performance issue for regexp in Reporting.kt (#4550)
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.
2022-01-31 23:25:18 +01:00
Brais Gabín
1fbe3b83d6 Revert "trim values when parsing the baseline (#4335)" (#4548) 2022-01-31 20:44:01 +00:00
Gabriel Freitas Vasconcelos
0b36ff0ea9 Adds issue details to findings on FindingsReport and FileBasedFindingsReporter (#4464)
* 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
2022-01-31 13:02:31 +01:00
Brais Gabín
2d00cab368 Fix AnnotationExcluder (#4518)
* Implement FullQualifiedNameGuesser

* Remove bad test

* Refactor tests

* Fix AnnotationExcluder

* More exhaustive list of default import classes

* Handle PR comments
2022-01-31 10:19:08 +01:00
marschwar
1ca3ab586e Fix error during snippet compilation (#4536) 2022-01-30 23:07:50 +01:00
Goooler
10e9e4c60d Code cleanups (#4542) 2022-01-30 17:12:03 +00:00
marschwar
a6a26142c5 [MaxLineLength] Fix signature in for blank characters in the Baseline (#4504) 2022-01-30 13:36:33 +00:00
marschwar
5176e41200 Fix MaxLineLength violation in IgnoredReturnValue rule (#4539)
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
2022-01-29 00:38:13 +01:00
Artem Zinnatullin :slowpoke
90ae9ecb07 Add list of functions to skip in IgnoredReturnValue rule (#4434)
* Add list of functions to skip in IgnoredReturnValue rule

* Fix formatting

* Regenerate default detekt config

* Switch to FunctionMatcher, rename property to ignoreFunctionCall

* Update test

* style

* Damn it IJ

* remove testing version

* Update detekt-rules-errorprone/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/IgnoredReturnValue.kt

Co-authored-by: Chao Zhang <zhangchao6865@gmail.com>

Co-authored-by: Brais Gabín <braisgabin@gmail.com>
Co-authored-by: Chao Zhang <zhangchao6865@gmail.com>
2022-01-28 17:43:48 +01:00
severn-everett
8a39d2a172 [VarCouldBeVal] Override vars will not be flagged if bindingContext is not set (#4477) 2022-01-28 01:36:39 +00:00
Brais Gabín
d0732ab2fd Add how to exclude source files from BaselineTask (#4490) 2022-01-28 01:33:26 +00:00
Matthew Haughton
58e95e6402 Re-enable warnings as errors (#4533)
* 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
2022-01-27 23:42:05 +01:00
renovate[bot]
f18644db92 Update dependency com.android.tools.build:gradle to v7.1.0 (#4530)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-27 23:41:20 +01:00
Goooler
e1dc93ed1d Disable deployment jobs in forked repository (#4528)
* Disable deploy-website job in forked repository

* Check repo on deploy-snapshot job
2022-01-26 08:45:52 +01:00
marschwar
3c12be91f2 Migrate tests in detekt-api to junit (#4521)
* 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>
2022-01-25 21:36:20 +01:00
Matthew Haughton
291590bc4e Use Java 17 for all CI jobs (#4526) 2022-01-26 07:31:07 +11:00
Matthew Haughton
77204be660 Migrate detekt-tooling tests to JUnit 5 (#4524) 2022-01-26 00:56:20 +11:00
Matthew Haughton
a236d80919 Migrate detekt-sample-extensions tests to JUnit (#4525) 2022-01-26 00:55:52 +11:00
Brais Gabín
c536107feb Use the new configure config for formatting (#4352)
* Improve

* Don't include formatting config inside default-detekt-config.yml

* Extract code from ConfigPrinter

* Create config file for detekt-formatting
2022-01-25 14:55:42 +01:00