* 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>
* 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>
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.
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.
* 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>
* 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>
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.
* 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
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.