Add a new rule CascadingCallWrapping which requires that if a chained call is placed on a newline then all subsequent calls must be as well, improving readability of long chains.
* 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>
* First draft of refactoring VarCouldBeVal to scan file- and class-level properties; Added checks in VarCouldBeVal to avoid flagging escaped object literals
* Added more tests and fixed failing ones
* Addressing PR comments
* Added @Parameter to ignore list for internal Detekt scanning; Fixed Detekt issues
* Addressing PR comment
* Add missing tests
* Add AnnotationSuppressor
* Use ignoreAnnotated instead of the custom ones from our rules
* Rename LongParameter.ignoreAnnotated to not clash with the general suppression
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
* Enable UnnecessaryLet rule for detekt code base
* baseline parser does not work with new lines
* replace let with private extension function to improve readability
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
* enable those rules from the style rule set that have not violation or obvious fixes
* Enable UseIfEmptyOrIfBlank
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
* 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>
* LongMethod: add 'ignoreAnnotated' configuration option
* Check annotations in visitNamedFunction
* Create AnnotationExcluder instance in visitKtFile
* Remove defalut value of ignoreAnnotated
* Remove defalut value of ignoreAnnotated in FunctionNaming
* Change definition order in ComplexMethod
* Use annotation in ComplexCondition
* Use annotation in ComplexInterface
* Use annotation in LabeledExpression
* Use annotation in LargeClass
* Use annotation in LongMethod
* Use annotation in LongParameterList
* Use annotation in MethodOverloading
* Use annotation in NamedArguments
The issue message had to be changed as the issue is used to
extract the rule id which is used to lookup the threshold from
the config.
* Use annotation in NestedBlockDepth
* Use annotation in TooManyFunctions
* Use annotation in StringLiteralDuplication
* replace removeSurrounding with removePrefix.removeSuffix
* inline default thresholds to improve readability
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
* Create initial idea for @Configuration annotation
* Use config parameter constants again
* Generate documentation from @Configuration
* Introduce config delegate and extract default value from it
* Exclude rules configured with annotation from checks
* Remove support for factory methods in RuleSetProviderCollector
* Add support for lists that are empty by default
* Update documentation for rule contribution
* Restrict config delegate to supported types
* Update .github/CONTRIBUTING.md
Co-authored-by: Brais Gabín <braisgabin@gmail.com>
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
Co-authored-by: Chao Zhang <zhangchao6865@gmail.com>
* Add @ActiveByDefault annotation
* Add support for @ActiveByDefault annotation
* Use annotation for all activated in v1.2.0
* Use annotation for all activated after v1.2.0
* Use annotation for all activated in v1.0.0
* Update documentation with regard to RuleSetProvider
* Update documentation
* Remove leading 'v' from version in annotation
* Use named parameter 'since' for @ActiveByDefault
* check version matches semantic version pattern.
* Fix typo and correct version format
* Fix merge errors
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
Co-authored-by: Chao Zhang <zhangchao6865@gmail.com>
* Change indentation according to ktlint
* Add test case to verify requiresTypeResolution flag
* Add RequiresTypeResolution annotation
* Generate documentation based on RequiresTypeResolution annotation
* Use @RequiresTypeResolution instead of kdoc tag
* Update documentation for @RequiresTypeResolution
* Remove support for @requiresTypeResolution kdoc tag
* Add @RequiresTypeResolution to public api
* Move extension functions to separate files
* Remove @RequiresOptIn from public api
* Update annotation comment
Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
* Introduce NamedArguments rule when function is invoked with more than default number of non-named parameters
* Change the documentation to make the intent of default threshold clear
* Add compliant and non-compliant code documentation. Add tests for constructor
* Report redundant internal modifier on declarations in private or local objects and classes
* Enable RedundantVisibilityModifierRule for detekt self-scans
* Use simpler test example
Co-authored-by: Nicola Corti <corti.nico@gmail.com>
Co-authored-by: Nicola Corti <corti.nico@gmail.com>
* Fix unsafe call issues or use cleaner preconditions
* Run detekt with type resolution analysis on CI
* Update detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/FindingsAssertions.kt
* Run detekt with type resolution analysis on CI
* Let detekt run only in separate CI job
* Revert change to open; instead suppress issue