Commit Graph

31 Commits

Author SHA1 Message Date
Paul Berry f8b1161496 Fix error_processor_test.dart's use of USE_OF_VOID_RESULT.
The message for this error code doesn't accept any arguments, so
there's no reason for the test to provide any.

Change-Id: I6306cead7865704c9074dd0dc2a1bc1aacaeda16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213724
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 15:48:51 +00:00
Konstantin Shcheglov 9f986d2501 Migrate package:analyzer to null safety.
Change-Id: Iffe4370431587e46a141ddc72a86ceec29c163b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176486
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-02-01 18:56:04 +00:00
Konstantin Shcheglov 8de8a1c226 Move codes from StaticTypeWarningCode into CompileTimeErrorCode.
They are all errors now.

Change-Id: If48d38e38e845fd5b5a950dd5514bf1cbbce03d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-27 16:44:15 +00:00
Konstantin Shcheglov ba92b78acd Move errors from StaticWarningCode to CompileTimeErrorCode.
Bug: https://github.com/dart-lang/sdk/issues/42821
Change-Id: I153c48d7a2e4a02026928e6203aacf8f2dc029ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155849
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-26 04:19:25 +00:00
Konstantin Shcheglov 364dd8936b Fix unnecessary_new in analyzer.
R=brianwilkerson@google.com

Change-Id: I70f80baa3da4b14c0a52c1f28da16a9ad26d7dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 01:11:30 +00:00
Konstantin Shcheglov f979bd9899 Merge RestrictedAnalysisContext into AnalysisContextImpl.
We don't have any useful / old API(s) in AnalysisContextImpl,
so the distinction between these two does not exist.

Change-Id: I87ef84bc728cc1c2c0e269c695419c425afb6559
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125987
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-21 21:58:16 +00:00
Brian Wilkerson 5f0de26d48 Clean up the remaining copyright notices
Change-Id: If099be4f71ba551df0dc3d69815ae6a9f55d1eba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97781
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-24 20:11:28 +00:00
Paul Berry 5e1397fc4e Remove unused import
Change-Id: I18837fe28a92fffc3a8f80460f34f14e94bb19de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96962
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-14 17:56:16 +00:00
Konstantin Shcheglov eeb19b0416 Remove usages of ExtensionManager and package:plugin in general.
R=brianwilkerson@google.com

Change-Id: I489e72464474b3d40d7678f44562f65934f93288
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96863
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-14 15:31:08 +00:00
Konstantin Shcheglov 1ba59eb13d Make ERROR the default severity for StaticWarningCode. Remove _StrongModeTypeErrorProcessor.
As a preparatory step for re-landing https://dart-review.googlesource.com/c/sdk/+/91170
and making these two restored problems to warnings.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I6266632ade84743b5725c54475fe402902576c00
Reviewed-on: https://dart-review.googlesource.com/c/91420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-28 22:08:17 +00:00
Brian Wilkerson e9eb4842ea Remove the unused hint code INVALID_ASSIGNMENT
Change-Id: I4b3aff6b53dcfb5d5f00c49992050e08e5b52002
Reviewed-on: https://dart-review.googlesource.com/c/88641
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-08 19:15:47 +00:00
Konstantin Shcheglov 2ede4c7543 Downgrade WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR to warning.
Per https://github.com/dart-lang/sdk/issues/34403#issuecomment-420465838
request.

R=brianwilkerson@google.com

Change-Id: I9a2c319d2262aacf14bfc180d59d16db3f199a2a
Reviewed-on: https://dart-review.googlesource.com/74560
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-12 19:11:26 +00:00
Brian Wilkerson ab1c1582b1 Remove deprecation hints in analyzer packages
Change-Id: I001e57239a87f2806be74052a5e7686245fea812
Reviewed-on: https://dart-review.googlesource.com/65000
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2018-07-17 15:22:07 +00:00
Brian Wilkerson b936ffb329 Move several libraries out of the public API
Change-Id: I8259de00134310f25b1c6168940aea5190488999
Reviewed-on: https://dart-review.googlesource.com/51443
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-17 17:35:27 +00:00
Brian Wilkerson 26c06cdd82 Clean up Dart 2 type issues related to YAML support
Change-Id: Ic29054afca9773286aa899eecede287f7ecbca9a
Reviewed-on: https://dart-review.googlesource.com/47680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-22 17:06:40 +00:00
Brian Wilkerson 8819d9fe98 Update analyzer tests for preview-dart-2, part 1
Change-Id: I3440607f7b3892193e1d9883709a1b9d4a7463d9
Reviewed-on: https://dart-review.googlesource.com/46562
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-15 16:45:04 +00:00
Mike Fairhurst 56d59dd967 Reland https://dart-review.googlesource.com/c/sdk/+/37441 with fixes
Change-Id: If8e2ec2ca1ac4f533dcb56b0c95d55e4a13e0598
Reviewed-on: https://dart-review.googlesource.com/39881
Reviewed-by: Paul Berry <paulberry@google.com>
2018-02-08 20:46:19 +00:00
Mike Fairhurst ec58f5646a Revert "Make void a static warning to use almost everywhere."
This reverts commit 09eed74a8a.

Reason for revert: Too much SDK code is not yet compliant.

Original change's description:
> Make `void` a static warning to use almost everywhere.
> 
> Changed the hint to a StaticWarningCode, since that's the new spec'd
> error type and the hint is no longer needed.
> 
> Added a new set of methods to test the cases.
> 
> Didn't try to solve the problem generally ("all usages except ... are
> errors" means it easier, in theory, to make a ReportVoidExpressions
> style visitor that catches absolutely all types) because most of the
> work is actually about suppressing errors that are no longer needed.
> Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
> put the void handling logic into each AST method specially anyway.
> 
> Some redundant tests removed.
> 
> Don't flag: ternaries, void -> void assignments, void returns in
> dynamic.
> 
> Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
> Reviewed-on: https://dart-review.googlesource.com/37441
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=leafp@google.com,scheglov@google.com,mfairhurst@google.com

Change-Id: I13ee4c6939468d35506779ade637a040833632f4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39848
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-07 22:32:51 +00:00
Mike Fairhurst 09eed74a8a Make void a static warning to use almost everywhere.
Changed the hint to a StaticWarningCode, since that's the new spec'd
error type and the hint is no longer needed.

Added a new set of methods to test the cases.

Didn't try to solve the problem generally ("all usages except ... are
errors" means it easier, in theory, to make a ReportVoidExpressions
style visitor that catches absolutely all types) because most of the
work is actually about suppressing errors that are no longer needed.
Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
put the void handling logic into each AST method specially anyway.

Some redundant tests removed.

Don't flag: ternaries, void -> void assignments, void returns in
dynamic.

Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
Reviewed-on: https://dart-review.googlesource.com/37441
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-07 21:36:01 +00:00
Devon Carew 796baf6f16 Fix an issue with configuring the severity of lints.
BUG=
R=brianwilkerson@google.com, pquitslund@google.com

Review-Url: https://codereview.chromium.org/2863013002 .
2017-05-05 13:17:04 -07:00
Konstantin Shcheglov 0728e4ee70 Implement 'analysis.getErrors' for the new driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2566013002 .
2016-12-11 15:27:57 -08:00
Brian Wilkerson 86c62a6bad Remove the command-line plugin
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2565993002 .
2016-12-11 10:59:19 -08:00
Brian Wilkerson a01afcd1d1 Remove the options plugin
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2569603002 .
2016-12-11 08:38:29 -08:00
Brian Wilkerson 0ea654a068 Remove the AnalysisOptionsProcessor
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2559523005 .
2016-12-07 10:51:33 -08:00
Konstantin Shcheglov 175dad4f15 Switch 'analyzer' to 'package:test' and test_reflective_loader ^0.1.0.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2391423003 .
2016-10-06 08:46:35 -07:00
Brian Wilkerson ecc84b26a4 Break up another large file
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2342733002 .
2016-09-15 07:49:27 -07:00
Brian Wilkerson 6dae827b70 More strong mode fixes for analyzer
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1842363004 .
2016-04-01 09:35:22 -07:00
Bob Nystrom a602585097 Don't upgrade the severity of *everything* to an error in strong mode.
Oops!

Fixes #26026.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1813973002 .
2016-03-17 12:58:18 -07:00
Bob Nystrom 2ef00b0c3d Don't report redundant type errors in strong mode.
Currently, "sideways casts" -- type errors where one type is assigned
to an unrelated type -- are reported by both ErrorVerifier and strong
mode's Checker. This leads to duplicate errors that the user can see.

ErrorVerifier's errors are generally better: they give the user more
contextual information and are easier to read. So this CL eliminates
Checker's reporting of these errors and only uses ErrorVerifier's.

However, in strong mode, type errors like this are fatal: DDC can't
generate correct code. So this also automatically upgrades all static
type warnings to errors when strong mode is enabled.

R=brianwilkerson@google.com, leafp@google.com

Review URL: https://codereview.chromium.org/1780783002 .
2016-03-15 12:14:11 -07:00
danrubel d26d023ce7 update tests for execution on windows
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1774623006 .
2016-03-09 22:33:35 -05:00
pq 62656833d4 Wraps up the server-side of the 'Allow a user to configure which hints are "fatal"' ask (#24452).
* migrates error filtering from a predicate to a process that can customize severities.
* moves filtering/processing from the `dart` task into the `getErrors` request and the errors notification.

See: https://github.com/dart-lang/sdk/issues/24452

(Pending a thumbs-up, support for CLI to follow.)

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1517723002 .
2015-12-10 13:35:11 -08:00