Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit f3a0cf9

Browse files
authored
refactor: deprecate GitHub reporter (#453)
1 parent 8be835d commit f3a0cf9

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
* Deprecated GitHub reporter.
6+
37
## 4.3.0-dev.1
48

5-
* Add support for global rules-exclude
9+
* Add support for global rules-exclude.
610
* Add `Halstead Volume` metric.
7-
* Add ability to configure anti-pattern severity
11+
* Add ability to configure anti-pattern severity.
812
* Add `--fatal-warnings`, `--fatal-performance`, `--fatal-style` cli arguments.
913

1014
## 4.2.1

lib/src/analyzers/lint_analyzer/reporters/reporters_list/github/lint_github_reporter.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import '../../../../../reporters/models/github_reporter.dart';
44
import '../../../models/lint_file_report.dart';
55
import '../../../models/severity.dart';
66

7+
const _deprecationMessage =
8+
'DEPRECATED! This reporter is deprecated and will be removed in 5.0.0. You can migrate on our GitHub Action.';
9+
710
class LintGitHubReporter extends GitHubReporter<LintFileReport> {
811
const LintGitHubReporter(IOSink output) : super(output);
912

@@ -16,7 +19,7 @@ class LintGitHubReporter extends GitHubReporter<LintFileReport> {
1619
for (final analysisRecord in records) {
1720
for (final antiPattern in analysisRecord.antiPatternCases) {
1821
output.writeln(GitHubReporter.commands.warning(
19-
antiPattern.message,
22+
'$_deprecationMessage ${antiPattern.message}',
2023
absolutePath: analysisRecord.path,
2124
sourceSpan: antiPattern.location,
2225
));
@@ -26,12 +29,12 @@ class LintGitHubReporter extends GitHubReporter<LintFileReport> {
2629
output.writeln(
2730
issue.severity == Severity.error
2831
? GitHubReporter.commands.error(
29-
issue.message,
32+
'$_deprecationMessage ${issue.message}',
3033
absolutePath: analysisRecord.path,
3134
sourceSpan: issue.location,
3235
)
3336
: GitHubReporter.commands.warning(
34-
issue.message,
37+
'$_deprecationMessage ${issue.message}',
3538
absolutePath: analysisRecord.path,
3639
sourceSpan: issue.location,
3740
),

test/analyzers/lint_analyzer/reporters/reporters_list/lint_github_reporter_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void main() {
6464
expect(
6565
verify(() => output.writeln(captureAny())).captured.cast<String>(),
6666
equals([
67-
'::warning file=/home/developer/work/project/example.dart,line=2,col=3::first issue message',
67+
'::warning file=/home/developer/work/project/example.dart,line=2,col=3::DEPRECATED! This reporter is deprecated and will be removed in 5.0.0. You can migrate on our GitHub Action. first issue message',
6868
]),
6969
);
7070
});
@@ -127,8 +127,8 @@ void main() {
127127
expect(
128128
verify(() => output.writeln(captureAny())).captured.cast<String>(),
129129
equals([
130-
'::warning file=/home/developer/work/project/example.dart,line=2,col=3::first issue message',
131-
'::error file=/home/developer/work/project/example.dart,line=4,col=3::second issue message',
130+
'::warning file=/home/developer/work/project/example.dart,line=2,col=3::DEPRECATED! This reporter is deprecated and will be removed in 5.0.0. You can migrate on our GitHub Action. first issue message',
131+
'::error file=/home/developer/work/project/example.dart,line=4,col=3::DEPRECATED! This reporter is deprecated and will be removed in 5.0.0. You can migrate on our GitHub Action. second issue message',
132132
]),
133133
);
134134
});

0 commit comments

Comments
 (0)