Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: preGen
  • Loading branch information
alestiago committed Sep 28, 2023
commit c6d076bcf941dfe540cbd9c6fc7bdd2e40760412
10 changes: 9 additions & 1 deletion bricks/spdx_license/hooks/pre_gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,17 @@ class GenerateSpdxLicenseException implements Exception {
final String message;
}

/// {@macro pre_gen}
Future<void> run(HookContext context) async => preGen(context);

/// {@template pre_gen}
/// Populates the context `licenses` variable with the SPDX license list, and
/// the `total` variable with the total number of licenses.
///
/// If the user decides to use their own license list, the `licenses` variable
/// will be populated with the user's list. Otherwise, the SPDX license list
/// will be downloaded and parsed from the same source as the PANA tool.
/// {@endtemplate}
@visibleForTesting
Future<void> preGen(
HookContext context, {
Expand All @@ -51,7 +60,6 @@ Future<void> preGen(
(licensesVar == null || (licensesVar is List && licensesVar.isEmpty)) &&
licensesVar is! List<String>;

// Download the SPDX licenses if they have not been provided by the user.
final licenses = shouldFetchLicenses
? await _downloadLicenses(
logger: context.logger,
Expand Down