Skip to content

Commit

Permalink
Remove further unused methods / making them private. (#1317)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Jan 16, 2024
1 parent 556ed22 commit 6670b00
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 51 deletions.
23 changes: 17 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@

**BREAKING CHANGES**

- Removed deprecated APIs.
- Removed `InspectOptions.checkRemoteRepository` - repositories are verified by default.
- Renamed `runProc` -> `runConstrained`.
- Removed `ProcessOutput.asBytes`.
- Removed:
- deprecated APIs
- `InspectOptions.checkRemoteRepository` - repositories are verified by default
- `ProcessOutput.asBytes`
- `ToolEnvironment`:
- removed parameters from `dartdoc()`
- `detectFlutterUse()`
- `get environment`
- `getFlutterVersion()`
- `analysisOptionsFiles`
- `changelogFileNames`
- `currentAnalysisOptionsFileName`
- `dartdocFailedSection`
- `firstFileFromNames`
- `licenseFileNames`
- `pubspecParseError`
- `readmeFileNames`
- `ToolException` has reference to the entire `PanaProcessResult`, instead of just the `stderr`.
- `ToolEnvironment`:
- removed parameters from `dartdoc()`
- removed `get environment`, `detectFlutterUse()` and `getFlutterVersion()`

## 0.21.45

Expand Down
2 changes: 1 addition & 1 deletion lib/pana.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

export 'src/dartdoc_analyzer.dart';
export 'src/download_utils.dart';
export 'src/maintenance.dart';
export 'src/maintenance.dart' show exampleFileCandidates;
export 'src/model.dart';
export 'src/package_analyzer.dart';
export 'src/pubspec.dart';
Expand Down
17 changes: 0 additions & 17 deletions lib/src/dartdoc_analyzer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,3 @@ ReportSection documentationCoverageSection({
status: accepted ? ReportStatus.passed : ReportStatus.failed,
);
}

/// Creates a report section when running dartdoc failed to produce content.
ReportSection dartdocFailedSection(String abortMessage) {
return ReportSection(
id: ReportSectionId.documentation,
title: documentationSectionTitle,
grantedPoints: 0,
maxPoints: 10,
summary: renderSimpleSectionSummary(
title: 'Failed to run dartdoc',
description: abortMessage,
grantedPoints: 0,
maxPoints: 10,
),
status: ReportStatus.failed,
);
}
5 changes: 3 additions & 2 deletions lib/src/license.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ import 'package:meta/meta.dart';
import 'package:pana/src/license_detection/license_detector.dart' hide License;
import 'package:path/path.dart' as p;

import 'maintenance.dart';
import 'model.dart';

const _licenseFileNames = ['LICENSE'];

Future<List<License>> detectLicenseInDir(String baseDir) async {
final licenses = <License>[];
for (final candidate in licenseFileNames) {
for (final candidate in _licenseFileNames) {
final file = File(p.join(baseDir, candidate));
if (!file.existsSync()) continue;
licenses.addAll(await detectLicenseInFile(file, relativePath: candidate));
Expand Down
25 changes: 0 additions & 25 deletions lib/src/maintenance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ library pana.maintenance;

import 'package:json_annotation/json_annotation.dart';

const changelogFileNames = ['CHANGELOG.md'];
const readmeFileNames = ['README.md'];

/// Returns the candidates in priority order to display under the 'Example' tab.
List<String> exampleFileCandidates(String package) {
return <String>[
Expand All @@ -25,28 +22,6 @@ List<String> exampleFileCandidates(String package) {
];
}

const licenseFileNames = ['LICENSE'];

const String currentAnalysisOptionsFileName = 'analysis_options.yaml';
final List<String> analysisOptionsFiles = const [
currentAnalysisOptionsFileName,
'.analysis_options',
];

String? firstFileFromNames(List<String> files, List<String> names,
{bool caseSensitive = false}) {
for (var name in names) {
for (var file in files) {
if (file == name) {
return file;
} else if (!caseSensitive && file.toLowerCase() == name) {
return file;
}
}
}
return null;
}

/// Returns a markdown-formatted error message for pubspec.yaml parse error.
String pubspecParseError(error) {
// TODO: remove this after json_annotation is updated with CheckedFromJsonException.toString()
Expand Down

0 comments on commit 6670b00

Please sign in to comment.