Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: pkg/analyzer_cli/lib/src/options.dart

Issue 2144383002: fix #26782, add no-implicit-casts, no-implicit-dynamic options (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merged Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer_cli/lib/src/driver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/lib/src/options.dart
diff --git a/pkg/analyzer_cli/lib/src/options.dart b/pkg/analyzer_cli/lib/src/options.dart
index 3706464c41c3469e8328a3bd67f4ca88ac8f9c48..030f1bfec653a3fa11b4fbc2ecd796ae27a1538a 100644
--- a/pkg/analyzer_cli/lib/src/options.dart
+++ b/pkg/analyzer_cli/lib/src/options.dart
@@ -150,6 +150,12 @@ class CommandLineOptions {
/// Whether to use strong static checking.
final bool strongMode;
+ /// Whether implicit casts are enabled (in strong mode)
+ final bool implicitCasts;
+
+ /// Whether implicit dynamic is enabled (mainly for strong mode users)
+ final bool implicitDynamic;
+
/// Whether to treat lints as fatal
final bool lintsAreFatal;
@@ -197,6 +203,8 @@ class CommandLineOptions {
sourceFiles = args.rest,
warningsAreFatal = args['fatal-warnings'],
strongMode = args['strong'],
+ implicitCasts = !args['no-implicit-casts'],
+ implicitDynamic = !args['no-implicit-dynamic'],
lintsAreFatal = args['fatal-lints'];
/// Parse [args] into [CommandLineOptions] describing the specified
@@ -478,7 +486,13 @@ class CommandLineOptions {
negatable: false,
hide: true)
..addFlag('strong',
- help: 'Enable strong static checks (https://goo.gl/DqcBsw)');
+ help: 'Enable strong static checks (https://goo.gl/DqcBsw)')
+ ..addFlag('no-implicit-casts',
+ negatable: false,
+ help: 'Disable implicit casts in strong mode (https://goo.gl/cTLz40)')
+ ..addFlag('no-implicit-dynamic',
+ negatable: false,
+ help: 'Disable implicit dynamic (https://goo.gl/m0UgXD)');
try {
// TODO(scheglov) https://code.google.com/p/dart/issues/detail?id=11061
« no previous file with comments | « pkg/analyzer_cli/lib/src/driver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698