Commit Graph

197 Commits

Author SHA1 Message Date
Mikhail Glukhikh 5b77def0e0 "if-then to safe access": treat transformation to 'let' as intention
Related to KT-7675
2018-08-15 12:36:01 +03:00
Toshiaki Kameyama f5cfec4a91 "if-then to safe access" inspection: support call expression -> let
#KT-7675 Fixed
2018-08-15 12:36:01 +03:00
Toshiaki Kameyama 2dcbf6aa34 Introduce "Redundant return label" inspection #KT-25270 Fixed 2018-08-15 12:36:01 +03:00
Toshiaki Kameyama b91f30ab15 Suspicious callable reference: no quick fix with invalid reference type
#KT-23467 Fixed
2018-08-15 12:36:00 +03:00
Toshiaki Kameyama 2bf3b435f2 Redundant semicolon: fix false positive between modifier and declaration
#KT-25579 Fixed
2018-08-14 15:32:26 +03:00
kenji tomita 443b1834bc Add "Replace assertBoolean() with assertEquals() inspection"
#KT-23445 Fixed
2018-08-14 14:11:14 +03:00
Mikhail Glukhikh 911f16845e For each parameter unused: add quick-fix "introduce anonymous parameter"
Related to KT-22068
2018-08-13 19:03:01 +03:00
Mikhail Glukhikh 6048647812 For each parameter unused: support correctly it() case
Related to KT-22068
2018-08-13 19:02:58 +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
Mikhail Glukhikh 87d81a75f3 Fix secondary constructor deletion in "sealed class -> object" 2018-08-09 13:33:03 +03:00
Toshiaki Kameyama 7e28cb1fe3 Call chain --> Sequence: take termination into account
Related to KT-15476
2018-08-08 11:02:47 +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
Natalia Selezneva be2d4964fd Fix testData, add script-runtime 2018-08-03 15:25:35 +03:00
Toshiaki Kameyama 1ac6f18a47 "Convert put to assignment": Fix false positive inside elvis expression
So #KT-22072 Fixed
2018-08-03 13:21:50 +03:00
Toshiaki Kameyama a059d50c8f "Call chain may be simplified": fix false positive on Java Map
So #KT-25089 Fixed
2018-08-03 13:15:53 +03:00
Toshiaki Kameyama 4c34ced1fa Introduct "Redundant 'with' call" inspection #KT-6633 Fixed 2018-08-02 09:23:27 +03:00
Mikhail Glukhikh cc1d9e88d5 1.3 migration: make inspections working for non-experimental coroutines 2018-07-24 10:24:18 +03:00
Toshiaki Kameyama 3e207fd6b2 Move lambda out: don't apply to multiple/default functional parameters
So #KT-24694 Fixed
2018-07-23 18:21:37 +03:00
Toshiaki Kameyama a9c91099a4 Correct "Redundant override" inspection message #KT-25608 Fixed 2018-07-23 18:21:37 +03:00
Dmitry Petrov acf0bb349c Update testData for restricted expression annotations retention 2018-07-20 10:39:51 +03:00
Nikolay Krasko 1973860e70 Indent content of when (KT-14066)
#KT-14066 Fixed
2018-06-22 19:19:12 +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
Toshiaki Kameyama 5ad98a139d "Redundant Companion": Don't suggest if same callable name is in use
So #KT-24425 Fixed
2018-06-19 12:48:10 +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 88974ee32b Can be private: simplification
Related to KT-22030
2018-06-13 18:12:31 +03:00
Toshiaki Kameyama 7786896e9b Can be private: don't report when object or subclass calls the function
Questionable
So #KT-22030 Fixed
2018-06-13 18:12:30 +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 4038d4d507 Explicit this inspection: suggest also for synthetic Java property
So #KT-22089 Fixed
2018-06-05 15:52:16 +03:00
Toshiaki Kameyama bde9a57c9e Don't suggest map{}.filterNotNull() -> mapNotNull{} on primitive array
So #KT-21556 Fixed
2018-06-05 15:18:28 +03:00
Alexey Sedunov fbb4914bfb Intentions: Fix insertion of necessary lambda parameter for run/let and apply/also conversions
#KT-22931 Fixed
2018-05-31 15:22:32 +03:00
Mikhail Glukhikh fbb0a3e06c Convert async {}.await() to withContext(DefaultDispatcher) {}
This fixes incorrect transformation related to KT-24235
2018-05-24 15:15:25 +03:00
Nikolay Krasko fdc6372776 Remove runtime usage from unused receiver parameter tests 2018-05-23 01:41:02 +03:00
Toshiaki Kameyama e7a9614fb5 "Unused receiver parameter" inspection: Fix false negative in same class (KT-23897)
#KT-23897 Fixed
2018-05-23 01:41:01 +03:00
Toshiaki Kameyama 8271e85dbb ReplaceArrayOfWithLiteralInspection: Remove unnecessary parentheses
#KT-21878 Fixed
2018-05-22 17:33:25 +03:00
Mon_chi c49eaf2604 Fix hint text for replace with operator assignment #KT-23559 Fixed 2018-05-15 13:26:23 +03:00
Mikhail Glukhikh 13be7803bb Introduce "redundant async" inspection #KT-24235 Fixed 2018-05-11 17:36:35 +03:00
Toshiaki Kameyama da92c844a6 Might be 'const': fix false positive in object literal #KT-23756 Fixed 2018-05-10 20:42:32 +03:00
Toshiaki Kameyama b5da48c566 Don't report suspicious callable reference on invoke with parameters
So #KT-23465 Fixed
2018-05-03 18:47:12 +03:00
Toshiaki Kameyama 13356d32fd Redundant SAM-constructor: highlight nested class name with outer class
So #KT-11156 Fixed
2018-05-03 18:32:44 +03:00
Mikhail Glukhikh e07f83ddbc "Redundant Unit" inspection: new tests, simplification & fixes
Related to KT-23977 and KT-24066
2018-05-03 16:12:20 +03:00
Toshiaki Kameyama 6e150d27f1 "Redundant Unit" inspection: fix for Unit returned as Any
So #KT-24066 Fixed
2018-05-03 16:12:19 +03:00
Toshiaki Kameyama c44cab4565 "Redundant Unit" inspection: Fix for labeled return #KT-23977 Fixed 2018-05-03 16:12:19 +03:00
Toshiaki Kameyama 89981ecbbb Lift Assignment: process lambda assignments in when correctly
So #KT-23346 Fixed
2018-04-28 18:44:29 +03:00
Mikhail Glukhikh df59af8ee8 Move sort modifiers test to inspection local group
This should fix test in 181 branch
2018-04-27 17:26:56 +03:00
Toshiaki Kameyama 3992f0215c "map.put() to assignment": handle case with labeled return inside
So #KT-23194 Fixed
2018-04-18 18:50:15 +03:00
Mikhail Glukhikh ef3ba5f0b1 Test local inspections on the fly via highlighting
Fixes problem with INFORMATION highlight type in batch mode (IDEA 181).
It's no more required to report INFORMATIONs in unit tests in batch.
2018-04-18 16:14:43 +03:00