1 | | // Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
|
2 | |
|
3 | | // for details. All rights reserved. Use of this source code is governed by a
|
4 | | // BSD-style license that can be found in the LICENSE file.
|
5 | |
|
6 | | /// Enum-like class for the different syntactic fixes that can be applied while
|
7 | | /// formatting.
|
8 | | class StyleFix {
|
9 | | static const docComments = const StyleFix._(
|
10 | | "doc-comments", 'Use triple slash for documentation comments.');
|
11 | |
|
12 | | static const functionTypedefs = const StyleFix._(
|
13 | | "function-typedefs", 'Use new syntax for function type typedefs.');
|
14 | |
|
15 | | static const namedDefaultSeparator = const StyleFix._(
|
16 | | "named-default-separator",
|
17 | | 'Use "=" as the separator before named parameter default values.');
|
18 | |
|
19 | | static const optionalConst = const StyleFix._(
|
20 | | "optional-const", 'Remove "const" keyword inside constant context.');
|
21 | |
|
22 | | static const optionalNew =
|
23 | | const StyleFix._("optional-new", 'Remove "new" keyword.');
|
24 | |
|
25 | | static const all = const [
|
26 | | docComments,
|
27 | | functionTypedefs,
|
28 | | namedDefaultSeparator,
|
29 | | optionalConst,
|
30 | | optionalNew
|
31 | | ];
|
32 | |
|
33 | | final String name;
|
34 | | final String description;
|
35 | |
|
36 | 2 | const StyleFix._(this.name, this.description);
|
37 | | }
|