Files
sdk/pkg/analyzer/lib/dart/analysis/code_style_options.dart
T
Ahmed Ashour e09493b7bc [analyzer] use preferred quote-style when generating imports
Bug #49559

Change-Id: Ib77ea67bb1ea15bfabb1c717cfb5abf13fd6d3cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-09-21 17:12:46 +00:00

39 lines
1.4 KiB
Dart

// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/ast/ast.dart';
/// A set of options related to coding style that apply to the code within a
/// single analysis context.
///
/// Clients may not extend, implement or mix-in this class.
abstract class CodeStyleOptions {
/// Return `true` if the `require_trailing_commas` is enabled and trailing
/// commas should be inserted in function calls and declarations.
bool get addTrailingCommas;
/// Return `true` if local variables should be `final` whenever possible.
bool get makeLocalsFinal;
/// Return the preferred quote based on the enabled lints,otherwise a single
/// quote.
String get preferredQuoteForStrings;
/// Return `true` if constructors should be sorted first, before other
/// class members.
bool get sortConstructorsFirst;
/// Return `true` if the formatter should be used on code changes in this
/// context.
bool get useFormatter;
/// Return `true` if URIs should be "relative", meaning without a scheme,
/// whenever possible.
bool get useRelativeUris;
/// Return the preferred quote based on the enabled lints, otherwise based
/// on the first directive, otherwise a single quote.
String preferredQuoteForUris(List<ImportDirective> directives);
}