* Enable ForbiddenMethodCall on detekt code base
* Move Resources extensions from tooling to utils
* Forbid Url.openStream calls and Class.getResourceAsStream
* Include custom get/set operators to ExplicitCollectionElementAccessMethod rule
This actually simplifies code, since any get/set operator can be treated the same; no need to look up type names. `Map.put()` is a type-specific edge case, which can be replaced by `set`, and thus indexed access, when the return value is not needed.
Right now, no check is done whether the return value is use. For both `set` and `put` no code smell should be reported if this is the case.
* Fix#4122: false positive ExplicitCollectionElementAccessMethod for used return values
* Fix new issues raised due to more exhaustive ExplicitElementAccessMethod
Also fixed other tests that were failing on build server.
* Additional edge case tests for ExplicitCollectionElementAccessMethod
This also includes an early out in case types can't be resolved, rather than iterating over supertypes.
* ExplicitCollectionElementAccessMethod rule requires types resolution
This will help reduce build times when changes are made to the precompiled
script plugins used in the build. This is because a change in buildSrc
causes the whole project to become out-of-date [0]. Using an included build
instead works around this problem.
[0] https://docs.gradle.org/7.2/userguide/organizing_gradle_projects.html#sec:build_sources
* move ConfigProperty to public api
* add config to api
* use config property in example rule
* remove ThresholdRule from extension guide
* mark LazyRegex as deprecated
* suppress deprecation warning
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
* Rename Tests to Spec
* Rename DetektMultiplatformSpecTest to Spec
* Use Spek memoization when declaring non trivial types
* Use Spek memoization when declaring non trivial types
* Apply correct code formatting
* Apply correct indentation
* Update Kotlin to 1.4.20
* Update assertj to 3.18.1
* Fix type V but V!! expected compilation errors with 1.4.20
* Remove workaround for old dokka plugin
* Update to Kotlin 1.4.21
* Use jdk8 compatible mockk version
* Update mock to version 1.10.4
* Specify source and target 1.8 java version for KotlinCompile tasks
* Remove shadowJarExecutable as it does not work with newest Kotlin compiler (1.4.20+)
* Simplify copying jars for CI by reusing copy task
* Update cli guide to always use the zip distribution
* fixup! Simplify copying jars for CI by reusing copy task
Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com>
* Introduce binding context aware members for FileProcessListener
* Use FileProcessListener with binding context everywhere
* Move deprecation on function level
* Move default config and config validation to core module
* Allow to load a yaml config from any Reader instance
It's okay to open up this method as the YamlConfig is internal and will move to the core module soon.
This change also allows to load yaml configurations from a string for tests.
* Move testing config validations to core module
* Provide sample test case on how to test ConfigValidator's
* Move checkConfiguration call to to core module
* Replace with new location of the default config file
* Make checkConfiguration again internal
* Extract KtCompiler to detekt-parser preparing a minimal test utils module
* Fix potential memory leak in tests not closing settings
* Move parsing and generic test utils to own module
* Do not depend on test module for metrics, gradle plugin and generator modules
* Exclude test-utils from coverage report as we do with test module
* Explicitly depend on core-module in tests
* Report file specific code smells at package or first declaration - #2699
* Report function specific code smells at identifier - #2699
* Report LargeClass smells at identifier - #2699
* Improve reporting at identifier for Deprecation issues - #2699
* Improve reporting for MethodOverloading issues - #2699
* Improve reporting at property name - #2699
This ensures that the temp directory is not polluted with unused files.
A helper function was created.
The created directory in the returned path is automatically deleted on JVM exit.
* Add tests showing how to exclude custom plugin properties in configuration files - #2169
* Mention config validation excludes in the website under extensions
* Remove author tag in /detekt-test sources
* Remove author tag in /detekt-sample-extension sources
* Remove author tag in /detekt-generator sources
* Remove author tag in /detekt-gradle-plugin sources
* Remove author tag in /detekt-formatting sources
* Remove author tag in /detekt-rules source
* Remove consecutive new lines
* Remove extra new lines
* Remove author tag in /detekt-core sources
* Remove author tag in /detekt-cli sources
* Remove consecutive new lines
* Fix failed LOC test