1
+ /*
2
+ * BSD 3-Clause License
3
+ *
4
+ * Copyright (c) 2020, Bitsy Darel
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ *
10
+ * 1. Redistributions of source code must retain the above copyright notice,
11
+ * this list of conditions and the following disclaimer.
12
+ *
13
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
14
+ * this list of conditions and the following disclaimer in the documentation
15
+ * and/or other materials provided with the distribution.
16
+ *
17
+ * 3. Neither the name of the copyright holder nor the names of its
18
+ * contributors may be used to endorse or promote products derived from
19
+ * this software without specific prior written permission.
20
+ *
21
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
+ * SUBSTITUTE GOODS OR
28
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ */
33
+
1
34
library dbstyleguidechecker;
2
35
3
36
import 'dart:io' ;
4
37
import 'package:meta/meta.dart' show protected;
5
38
6
- import 'package:dbstyleguidechecker/src/style_guide_violation .dart' ;
39
+ import 'package:dbstyleguidechecker/src/code_style_violation .dart' ;
7
40
8
- export 'package:dbstyleguidechecker/src/checkers/dart/ dart_project_style_guide_checker.dart' ;
9
- export 'package:dbstyleguidechecker/src/checkers/dart/ flutter_project_style_guide_checker.dart' ;
41
+ export 'package:dbstyleguidechecker/src/checkers/dart_project_style_guide_checker.dart' ;
42
+ export 'package:dbstyleguidechecker/src/checkers/flutter_project_style_guide_checker.dart' ;
10
43
export 'package:dbstyleguidechecker/src/reporters/console_code_style_violations_reporter.dart' ;
11
44
export 'package:dbstyleguidechecker/src/reporters/github/github_pull_request_style_guide_check_reporter.dart' ;
12
- export 'package:dbstyleguidechecker/src/reporters/file_style_guide_violation_reporter .dart' ;
13
- export 'package:dbstyleguidechecker/src/parsers/dart/ dart_analyzer_violation_parser.dart' ;
45
+ export 'package:dbstyleguidechecker/src/reporters/file_code_style_violation_reporter .dart' ;
46
+ export 'package:dbstyleguidechecker/src/parsers/dart_analyzer_violation_parser.dart' ;
14
47
export 'package:dbstyleguidechecker/src/exceptions.dart' ;
15
48
export 'package:dbstyleguidechecker/src/utils/script_utils.dart' ;
16
49
export 'package:dbstyleguidechecker/src/reporters/github/github_utils.dart' ;
50
+ export 'package:dbstyleguidechecker/src/reporters/json_code_style_violation_reporter.dart' ;
17
51
18
- /// Style guide linter .
52
+ /// Code Style Violations Checker .
19
53
///
20
- /// Verify a coding style guide against a project.
54
+ /// Check a coding style guide against a project.
21
55
abstract class CodeStyleViolationsChecker {
22
56
/// style guide to verify.
23
57
final File styleGuide;
@@ -29,7 +63,7 @@ abstract class CodeStyleViolationsChecker {
29
63
final CodeStyleViolationsParser parser;
30
64
31
65
/// Report founded style check violations.
32
- final CodeStylesViolationsReporter reporter;
66
+ final CodeStyleViolationsReporter reporter;
33
67
34
68
/// create a [CodeStyleViolationsChecker] .
35
69
///
@@ -40,12 +74,10 @@ abstract class CodeStyleViolationsChecker {
40
74
/// [parser] to parse founded style guide violations.
41
75
///
42
76
/// [reporter] to report founded style guide violations.
43
- const CodeStyleViolationsChecker (
44
- this .styleGuide,
45
- this .projectDir,
46
- this .parser,
47
- this .reporter,
48
- );
77
+ const CodeStyleViolationsChecker (this .styleGuide,
78
+ this .projectDir,
79
+ this .parser,
80
+ this .reporter,);
49
81
50
82
/// Run the checker.
51
83
Future <void > check () async {
@@ -64,18 +96,18 @@ abstract class CodeStyleViolationsChecker {
64
96
Future <String > getCodeStyleViolations ();
65
97
}
66
98
67
- /// Style guide violations reporter.
99
+ /// Code style violations reporter.
68
100
///
69
- /// Report style guide violations.
70
- abstract class CodeStylesViolationsReporter {
71
- /// Create a constant instance of a [CodeStylesViolationsReporter ] .
72
- const CodeStylesViolationsReporter ();
101
+ /// Report code style violations.
102
+ abstract class CodeStyleViolationsReporter {
103
+ /// Create a constant instance of a [CodeStyleViolationsReporter ] .
104
+ const CodeStyleViolationsReporter ();
73
105
74
106
/// Report [violations] .
75
107
Future <void > report (final List <CodeStyleViolation > violations);
76
108
}
77
109
78
- /// Style guide violation parser.
110
+ /// Code style violations parser.
79
111
///
80
112
/// Parse founded violations.
81
113
abstract class CodeStyleViolationsParser {
@@ -85,8 +117,6 @@ abstract class CodeStyleViolationsParser {
85
117
/// Parse violations contained in the [violations] .
86
118
///
87
119
/// [projectDir] the violations are coming from.
88
- Future <List <CodeStyleViolation >> parse (
89
- final String violations,
90
- final String projectDir,
91
- );
120
+ Future <List <CodeStyleViolation >> parse (final String violations,
121
+ final String projectDir,);
92
122
}
0 commit comments