Commit Graph

484 Commits

Author SHA1 Message Date
Roman Elizarov e2713501ce Rename SuccessOrFailure to Result and hide Failure from ABI
* The members of Result are isSuccess, isFailure, exceptionOrNull, getOrNull
* The rest of API is implemented via inline-only extensions
* There are two internal functions to hide detailed mechanics of an internal
  Result.Failure class: createFailure and throwOnFailure
* Result.toString is explicit: either Success(v) or Failure(x)

See KT-26538
2018-09-09 11:34:31 +03:00
Mikhail Glukhikh 4dd95e5640 Introduce OptionalExpectationInspection
It works at INFORMATION level only and is intended to form quick-fixes
to add relevant actual declarations.

#KT-25533 Fixed
2018-09-05 13:05:07 +03:00
Toshiaki Kameyama 53c10238d6 Introduce inspection for safe cast + return #KT-26230 Fixed 2018-08-31 15:03:25 +03:00
Toshiaki Kameyama 2c71b3873e Introduce "flatMap { it } -> flatten" inspection #KT-25969 Fixed 2018-08-31 15:03:24 +03:00
Mikhail Glukhikh 7a2d0a3bb2 Add inspection "Redundant runCatching {}" (related to KT-25621) 2018-08-24 18:00:44 +03:00
Mikhail Glukhikh 87d750aa1c Add inspection to detect functions with SuccessOrFailure return type
Partial implementation of KT-25621 (no quick-fixes yet)
2018-08-24 18:00:41 +03:00
Mikhail Glukhikh 3dc2c07b23 Simplify description of "Deferred result not used" #KT-25711 Fixed 2018-08-23 18:35:00 +03:00
Toshiaki Kameyama f1dc09f839 Add postfix template for the spread operator #KT-26249 Fixed 2018-08-22 10:56:39 +03:00
Toshiaki Kameyama 2dcbf6aa34 Introduce "Redundant return label" inspection #KT-25270 Fixed 2018-08-15 12:36:01 +03:00
Toshiaki Kameyama 1898df3fb7 Introduce "Convert property getter to initializer" intention
#KT-13854 Fixed
2018-08-14 15:32:20 +03:00
kenji tomita 443b1834bc Add "Replace assertBoolean() with assertEquals() inspection"
#KT-23445 Fixed
2018-08-14 14:11:14 +03:00
Dennis Cornwell e81eee4cc1 Introduce inspection for determining if a forEach parameter is unused
#KT-22068 Fixed
2018-08-13 19:02:53 +03:00
Toshiaki Kameyama f2fec6b078 Fix messages #KT-25177 2018-08-09 15:24:20 +03:00
Toshiaki Kameyama 605736b6ba Introduce "redundant asDynamic" inspection #KT-25177 Fixed 2018-08-09 15:24:20 +03:00
Toshiaki Kameyama 108dea5b46 Introduce "Call chain on collection should be converted into 'Sequence'"
So #KT-15476 Fixed
2018-08-08 10:29:10 +03:00
Vyacheslav Gerasimov 0103c0d2fd Switch to 182 platform 2018-08-02 18:17:06 +03:00
Toshiaki Kameyama 4c34ced1fa Introduct "Redundant 'with' call" inspection #KT-6633 Fixed 2018-08-02 09:23:27 +03:00
Alexey Sedunov 04500914f3 Misc: Update Kotlin Gradle script icons for IDEA 182
#KT-25356 Fixed
2018-07-27 16:08:12 +03:00
Toshiaki Kameyama 9e83506c02 Introduce intention: trimMargin <--> trimIndent #KT-25056 Fixed 2018-07-25 12:30:00 +03:00
Nikolay Krasko adfa469b21 Maven inspection for incompatible coroutines libraries (KT-25251)
#KT-25251 In Progress
2018-07-19 16:09:56 +03:00
Nikolay Krasko 2a6dfba8bc Check kotlinx.coroutines libraries used with Kotlin 1.3 in Gradle (KT-25251)
#KT-25251 In Progress
2018-07-17 02:46:34 +03:00
Nikolay Krasko f9de91016a Inspection for experimental coroutines imports migration (KT-25251)
#KT-25251 In Progress
2018-07-17 02:22:14 +03:00
Nikolay Krasko b51880332e Migration inspection for fromClosedRange() call (KT-17176)
#KT-17176 Open
2018-07-11 14:25:24 +03:00
Denis Zharkov 0d00eb7de3 Add postfix template for listOf/setOf/etc
#KT-25239 Fixed
2018-07-06 10:06:56 +03:00
kenji tomita 817d75a47f Introduce ReplaceToStringWithStringTemplateInspection #KT-13782 Fixed 2018-06-20 17:18:17 +03:00
Toshiaki Kameyama 6675d7814c KT-14779 Inspection to replace String.format with string templates (#1645)
* Add inspection to replace String.format with string templates #KT-14779 Fixed

* KT-14779 Fixed
2018-06-20 16:23:04 +03:00
Toshiaki Kameyama e41a34af88 KT-11850 Add nested lambdas with implicit parameters warning (#1664)
* Add `Nested lambda has shadowed implicit parameter` inspection #KT-11850 Fixed

* KT-11850 Fixed
2018-06-20 15:57:03 +03:00
Toshiaki Kameyama 69d2e8898a "Main should return Unit" inspection: extend on JUnit test methods
So #KT-24509 Fixed
2018-06-19 12:48:11 +03:00
Mikhail Glukhikh 9ef89447b3 Sealed sub-class -> object: handle equals, suggest "add equals"
Before this commit, sealed sub-class without state was considered
a style issue.
After this commit, sealed sub-class without state AND custom equals
is considered a probable bug,
because comparison of its instances is very fragile.
Alternative fix (generate equals & hashCode by identity) is added.
2018-06-19 11:20:26 +03:00
Mikhail Glukhikh a09f6e14a5 Do not suggest "convert to object" for sealed sub-classes with state
So #KT-24816 Fixed
2018-06-13 18:12:18 +03:00
Toshiaki Kameyama 2c59f96ca4 Introduce "Add remaining when branches" intention #KT-23306 Fixed 2018-06-05 15:19:09 +03:00
Mikhail Glukhikh b8375d4864 Extend "async result unused" to "Deferred result unused" #KT-15063 Fixed 2018-05-22 17:07:05 +03:00
Mikhail Glukhikh ffcfa51fbf Introduce inspection "async result unused" #KT-24433 Fixed 2018-05-22 16:39:14 +03:00
Toshiaki Kameyama 8a20d1bf01 Add intention to convert lambda to anonymous function #KT-7710 Fixed 2018-05-16 13:01:36 +03:00
Mikhail Glukhikh 13be7803bb Introduce "redundant async" inspection #KT-24235 Fixed 2018-05-11 17:36:35 +03:00
Toshiaki Kameyama da92eb63a0 Add intention replacing vararg with array and vice versa #KT-23419 Fixed 2018-05-08 18:37:09 +03:00
Toshiaki Kameyama a7110a1517 Add intention to indent a raw string #KT-9943 Fixed 2018-05-03 17:05:14 +03:00
Natalia Selezneva 26f1d6ae7c Update Icon for .kts and .gradle.kts files
^KT-23431 Fixed
2018-04-27 13:52:31 +03:00
Natalia Selezneva 9107ef6490 New Script File Action
^KT-10935 Fixed
2018-04-27 13:52:26 +03:00
Toshiaki Kameyama e58d9c5507 Add intention for converting to block comment and vise versa
So #KT-23137 Fixed
2018-04-24 11:57:56 +03:00
Toshiaki Kameyama 03902030ed Add intentions to put arguments / parameters on one line #KT-23266 Fixed 2018-04-18 20:45:31 +03:00
Toshiaki Kameyama 1cd438c3f7 Add inspection "main should return Unit" #KT-16085 Fixed 2018-04-18 10:59:23 +03:00
kenji tomita decf9939fe MoveLambdaOutsideParentheses: intention -> inspection #KT-21413 Fixed 2018-04-12 11:03:40 +03:00
Gabryel Monteiro df7968678a Add inspection: Refactor sealed sub-class to object #KT-20305 Fixed 2018-04-11 14:51:00 +03:00
Mikhail Glukhikh 2125c42328 Make DeprecatedCallableAddReplaceWithInspection applicability based
Removes intention version of the same thing
Includes some optimization of 'Deprecated' annotation detection
2018-04-03 17:46:27 +03:00
Mikhail Glukhikh 34de241154 Add inspection to detect public API with implicit type 2018-03-29 11:39:01 +02:00
Toshiaki Kameyama e06c13732f Add intentions for specifying use-site targets for an annotation
So #KT-19871 Fixed
2018-03-23 13:03:00 +03:00
Toshiaki Kameyama 3fbf85dc37 Add inspection to highlight unnecessary explicit companion references
So #KT-22971 Fixed
2018-03-21 09:15:48 +03:00
Alexey Belkov 3b2bbee595 Standardize and improve descriptions of intentions/inspections 2018-03-15 09:56:47 +03:00
Toshiaki Kameyama f48eacfbd4 Add inspection (INFORMATION) to convert Pair constructor into to call
So #KT-22933 Fixed
2018-03-07 15:40:19 +03:00