Commit Graph

4317 Commits

Author SHA1 Message Date
Matthew Haughton
bd262c6fa5 Update dependency com.gradle.plugin-publish to 1.0.0-rc-3 (#4970) 2022-06-21 07:51:28 +10:00
Matthew Haughton
ecd28cf1a3 Simplify signing config (#4971) 2022-06-19 22:03:50 -07:00
Matthew Haughton
06ee239441 Use plain ASCII output in standard reports (#4968) 2022-06-19 02:07:41 +02:00
Matthew Haughton
b06276af54 Fix rule code samples to be valid Kotlin code (#4969) 2022-06-19 02:05:29 +02:00
renovate[bot]
8b62ffc105 Update dependency com.github.breadmoirai:github-release to v2.4.1 (#4965)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-17 09:03:48 -07:00
Matthew Haughton
e8e1f35dfc Set strict dependency on tested Kotlin compiler version (#4822)
This effectively pins the Kotlin compiler version used by detekt-cli,
minimising the chance of it being overridden and causing issues such as
#4786
2022-06-15 09:34:02 +02:00
renovate[bot]
195d15a04c Update react monorepo to v18.2.0 (#4958)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-15 00:22:08 +02:00
renovate[bot]
feec74c841 Update plugin binaryCompatibilityValidator to v0.10.1 (#4954)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-14 16:14:52 +02:00
Brais Gabín
a10e957c3d Improve readme (#4914)
* Move integrations down

* Remove old integration

* Move more integrations down

* More improvements

* Improve the detekt features

* Update link

* Improve website/docs/intro.mdx

* Add links to kotlin homepage

* Update README.md

Co-authored-by: schalkms <30376729+schalkms@users.noreply.github.com>

* Add complexity reports back

Co-authored-by: schalkms <30376729+schalkms@users.noreply.github.com>
2022-06-14 10:05:28 +02:00
Vitaly V. Pinchuk
5d49409814 Add Markdown report (#4858)
Co-authored-by: Brais Gabín <braisgabin@gmail.com>
2022-06-14 06:06:05 +01:00
Chao Zhang
43ea42ca51 Fix a typo in GRADLE_CACHE_PASSWORD credentials and enable remote cache write for two workflows (#4951) 2022-06-13 17:40:17 +02:00
Artur Bosch
1d47fd3673 Support disabling config validation via tooling spec (#4937) 2022-06-12 22:42:26 -07:00
Nicola Corti
43e0a4adc4 Remove Sonarqube Gradle Plugin (#4950) 2022-06-12 22:38:06 -07:00
Matthew Haughton
d3cdbb6da6 Enable GE build scan publishing for all workflows (#4947) 2022-06-13 11:29:39 +10:00
renovate[bot]
44d0e81a80 Pin Github Actions SHAs (#4938)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-13 01:21:49 +01:00
Chao Zhang
d06b109568 Gradle Enterprise Trial (#4763)
* Refactor `JvmSpec` to avoid using test resources

* Build a utility to copy resource files into temporary files

* Fix deprecation warning on jacocoMergedReport

* Add back `jvm` test fixtures

* Enabled Remote Build cache

* Change androidSdkInstalled to a boolean flag

* Use consistent warningsAsErrors

* Enable local build cache

* Fix MaxLineLength violation

* Update build-logic/src/main/kotlin/module.gradle.kts

Co-authored-by: Brais Gabín <braisgabin@gmail.com>

* Add a separate job to enable `warningsAsErrors`

Co-authored-by: Nicola Corti <corti.nico@gmail.com>
Co-authored-by: Brais Gabín <braisgabin@gmail.com>
2022-06-12 14:21:22 -07:00
Matthew Haughton
e33878ce7b Drop dependency-analysis plugin (#4946)
This is blocking update to Kotlin 1.7.0 (#4821)
2022-06-12 08:31:28 +10:00
renovate[bot]
2f75d2c318 Update plugin com.gradle.enterprise to v3.10.2 (#4939)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-09 20:14:57 -07:00
Artur Bosch
7c485f5c3d Provide a priority field for DetektProvider so tools can easier choose their provider implemention in tests for example (#4923) 2022-06-09 00:34:47 +02:00
renovate[bot]
cdf487a94b Update plugin dependencyAnalysis to v1.5.0 (#4933)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-08 08:52:22 +02:00
Brais Gabín
15012d716c Add missing redirect (#4931) 2022-06-07 22:30:59 +01:00
Toshiaki Kameyama
0ecebd4f61 UnusedPrivateMember: highlight declaration name (#4928) 2022-06-07 21:14:51 +02:00
Nicola Corti
9146e4d1f6 Fix various rendering problem on the formatting ruleset (#4911) 2022-06-04 13:02:11 +01:00
Dominic Zirbel
4b30c6be87 CastToNullableType: allow casting null keyword (#4907)
Fix a false positive for CastToNullableType for casting a literal `null` to a nullable type. This can be necessary when providing null as a function argument where the incoming type is parameterized. In this case using e.g. `null as? String` is less meaningful and generates a compiler warning that the cast cannot succeed.
2022-06-04 13:25:06 +02:00
renovate[bot]
ae7b41b571 Update plugin com.gradle.common-custom-user-data-gradle-plugin to v1.7.2 (#4897)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-04 13:23:37 +02:00
Gabriel Freitas Vasconcelos
5baf1f6955 Creates ForbiddenSuppress rule (#4899)
This rule is based on discussion #4890.

Checks for suppression of one or more rules that have been decided to
never be suppressed within a code base. For example, if we've set
MaximumLineLength to a value, every file must be compliant, and if there
is a special case where compliance is discouraged, we can simply exclude
this file within YML configuration.

This rule cannot prevent itself from being suppressed, but should serve
to discourage the over use of `@Suppress` annotations.
2022-06-03 17:19:23 +01:00
Nicola Corti
1eaa34b30d Cleanup the githubRelease task (#4903) 2022-06-03 15:02:41 +02:00
Nicola Corti
010f5edaf2 Remove the docs folder as it's unnecessary (#4904) 2022-06-03 15:01:42 +02:00
Nicola Corti
ad9ef16bb9 Correct the Rules Documentation label (#4901) 2022-06-03 01:11:56 +02:00
Nicola Corti
6d477cbb2e Prepare 1.21.0-RC1 (#4900) v1.21.0-RC1 2022-06-03 01:10:29 +02:00
renovate[bot]
fae633bab1 Update plugin dependencyAnalysis to v1.4.0 (#4898)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-03 08:24:24 +10:00
schalkms
c4fc4ff1b5 Remove unused code (#4902) 2022-06-02 22:57:18 +02:00
Matthew Haughton
1258c2fe82 Add dependency-analysis plugin and implement some recommendations (#4798)
Co-authored-by: schalkms <30376729+schalkms@users.noreply.github.com>
2022-06-02 13:19:44 +01:00
Peter
8e27a307ee NestedScopeFunctions - Add rule for nested scope functions (#4788) 2022-06-02 13:18:16 +01:00
marschwar
23a03e190d Allow additionalJavaSourceRootPaths to be defined on @KotlinCoreEnvironmentTest (#4771)
* Allow additionalJavaSourceRootPaths to be defined on @KotlinCoreEnvironmentTest

* update api

* Rename top level nested classes to WithDefaultSources and WithAdditionalJavaSources

* fix compilation error in java < 11

* fix upstream merge

* fix: do not attempt to compile snippet with java class from resource

* manually fix indentation of test snippets

Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
2022-06-02 00:07:49 +02:00
schalkms
eb7c335f9e Reformat Markdown files to comply with the spec (#4891) 2022-06-02 00:00:56 +02:00
schalkms
4cc4051706 Declare nested test classes as non-static (#4894)
The @Nested annotation cannot be used on static classes.
2022-06-01 23:51:44 +02:00
schalkms
5c41ebb2b6 Simplify regular expressions (#4893)
* Simplify regular expressions

* Inline class declaration

Co-authored-by: Brais Gabín <braisgabin@gmail.com>
2022-06-01 23:38:45 +02:00
schalkms
8b365028ec Remove redundant character escape in RegExp (#4892) 2022-06-01 23:08:27 +02:00
Brais Gabín
6d2933dc42 Active rules by default (#4875) 2022-06-01 23:02:12 +02:00
schalkms
8fbcf20591 Remove deprecated usages in gradle-plugin test (#4889) 2022-06-01 22:57:37 +02:00
marschwar
16b66586bc Allow users and rule authors to specify a reason per configured value (#4611)
* implement first idea on values with reasons

* have ExplainedValues implement List by delegation

* Parse explained value defaults

* fix error message

* [WIP] support ExplainedValues in yaml

* print markdown value in DefaultValue directly

* quote values in yaml maps

* Update detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/ConfigProperty.kt

Co-authored-by: Brais Gabín <braisgabin@gmail.com>

* Update detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/ConfigProperty.kt

Co-authored-by: Brais Gabín <braisgabin@gmail.com>

* add test case for missing reason

* fail fast in case of invalid configuration

* rename explainedValues to valuesWithReason

* add api documentation

* resolve and suppress code smells

* suppress UNCHECKED_CAST

* merge RuleCollectorSpec

* reformat spec

* fix indentation of test code

Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
Co-authored-by: Brais Gabín <braisgabin@gmail.com>
2022-06-01 21:19:28 +02:00
Vitaly V. Pinchuk
fe03b6dd26 Improve exception message (#4823)
* Improve exception message

Report detailed location of an error.

* Add test case

* Split tests

* Improve error location message presentation
2022-06-01 20:07:44 +02:00
Dominic Zirbel
db0b4b5b06 UselessCallOnNotNull: fix false positive for unresolved types (#4880)
Fix an issue where UselessCallOnNotNull would report issues when some of the argument types resolved as ErrorType. While it correctly handles cases where the BindingContext cannot resolve a type (the first test case), in cases where a call is made on an unknown type (the second test case, e.g. via takeIf{}) the BindingContext will report it as an ErrorType. Since ErrorType.isNullable() apparently returns false we need to make an exception to ensure the rule behaves as expected.
2022-06-01 20:03:45 +02:00
Toshiaki Kameyama
05cd79612f UnnecessaryInnerClass: fix false negative with this references (#4884) 2022-06-01 18:55:51 +02:00
Matthew Haughton
80bae4bdc5 Revert "Display dynamic --jvm-target values when using --help flag (#4694)" (#4816) 2022-06-01 14:26:11 +01:00
Marie Katrine Ekeberg
a949686e71 Add new rule CouldBeSequence (#4855)
* Add new rule CouldBeSequence

* Add test case for CouldBeSequence

* Fix inconsistency in compliant example for CoudlBeSequence
2022-06-01 10:59:46 +02:00
schalkms
f66a3217b9 Update MagicNumber rule to exclude .kts files (#4877)
* Update MagicNumber rule to exclude .kts files

The MagicNumber rule should not be enforced in script files,
because you cannot have constants in these files.

Closes #4863

* Adapt Exclusion.kt for MagicNumber rule
2022-05-31 22:04:03 +01:00
renovate[bot]
b2ef7a6345 Update docusaurus monorepo to v2.0.0-beta.21 (#4869)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-31 17:37:40 +01:00
Dominic Zirbel
d958fbf5f5 CanBeNonNullable: fix false positives for parameterized types (#4870)
CanBeNonNullable reports that properties of parameterized types can be marked as non-nullable even when this is impossible, just because the parameterized type is itself nullable (i.e. does not inherit from a non-nullable type). Instead, the rule should only report cases where a property is explicitly marked nullable but does not need to be.
2022-05-30 22:26:55 +02:00