Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
blaugold committed Jul 5, 2022
1 parent 6ed1a99 commit d9409f9
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 38 deletions.
30 changes: 18 additions & 12 deletions packages/conventional_commit/lib/conventional_commit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ enum SemverReleaseType {
major,
}

/// A representation of a parsed conventional commit message. Parsing is based
/// upon the Conventional Commits 1.0.0 specification available at
/// https://www.conventionalcommits.org/en/v1.0.0/
/// A representation of a parsed conventional commit message.
///
/// Parsing is based upon the Conventional Commits 1.0.0 specification available
/// at https://www.conventionalcommits.org/en/v1.0.0/
class ConventionalCommit {
ConventionalCommit._({
required this.header,
Expand Down Expand Up @@ -190,9 +191,11 @@ class ConventionalCommit {
final bool isBreakingChange;

/// The description of the breaking change, e.g. the text after BREAKING
/// CHANGE: <description>. Will be null if [isBreakingChange] is false.
/// Defaults to [description] if the `BREAKING CHANGE:` footer format was not
/// used, e.g. only `!` after the commit type was specified.
/// CHANGE: <description>.
///
/// Will be null if [isBreakingChange] is false. Defaults to [description] if
/// the `BREAKING CHANGE:` footer format was not used, e.g. only `!` after the
/// commit type was specified.
final String? breakingChangeDescription;

/// Whether this commit was a merge commit, e.g. `Merge #24 into main`
Expand All @@ -205,15 +208,18 @@ class ConventionalCommit {
/// commit message.)
final String header;

/// An optional body describing the change in more detail. Note this can
/// contain multiple paragraphs separated by new lines.
/// An optional body describing the change in more detail.
///
/// Note this can contain multiple paragraphs separated by new lines.
final String? body;

/// Footers other than BREAKING CHANGE: <description> may be provided and
/// follow a convention similar to git trailer format. A footer’s token MUST
/// use "-" in place of whitespace characters, e.g., Acked-by (this helps
/// differentiate the footer section from a multi-paragraph body). An
/// exception is made for BREAKING CHANGE, which MAY also be used as a token.
/// follow a convention similar to git trailer format.
///
/// A footer’s token MUST use "-" in place of whitespace characters, e.g.,
/// Acked-by (this helps differentiate the footer section from a
/// multi-paragraph body). An exception is made for BREAKING CHANGE, which MAY
/// also be used as a token.
final List<String> footers;

// TODO(Salakar): this api should probably not be in this package
Expand Down
2 changes: 1 addition & 1 deletion packages/melos/lib/src/commands/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ mixin _VersionMixin on _RunMixin {
// allows all versions guaranteed to be backwards compatible with the
// specified version.
// For example, ^1.2.3 is equivalent to '>=1.2.3 <2.0.0', and ^0.1.2 is
//equivalent to '>=0.1.2 <0.2.0'.
// equivalent to '>=0.1.2 <0.2.0'.
var versionConstraint = VersionConstraint.compatibleWith(version);

// For nullsafety releases we use a >=currentVersion <nextMajorVersion
Expand Down
7 changes: 4 additions & 3 deletions packages/melos/lib/src/common/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,10 @@ void sortPackagesTopologically(List<Package> packages) {
}

/// Given a workspace and package, this assembles the correct command to run pub
/// / dart pub / flutter pub. Takes into account a potential sdk path being
/// provided. If no sdk path is provided then it will assume to use the pub
/// command available in PATH.
/// / dart pub / flutter pub.
///
/// Takes into account a potential sdk path being provided. If no sdk path is
/// provided then it will assume to use the pub command available in PATH.
List<String> pubCommandExecArgs({
required bool useFlutter,
required MelosWorkspace workspace,
Expand Down
2 changes: 1 addition & 1 deletion packages/melos/lib/src/common/versioning.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Version nextVersion(
} else if (currentVersion.major == 0) {
// Bump the 'major' version again if the preids changed
// (e.g. dev to nullsafety) and the current version is not yet full
//semver (>= 1.0.0), e.g.:
// semver (>= 1.0.0), e.g.:
// `0.1.0-dev.5` should become `0.2.0-1.0.nullsafety.0`
// and not `0.1.0-1.0.nullsafety.0`.
// >=1.0.0 is already handled by [nextStableVersion].
Expand Down
35 changes: 18 additions & 17 deletions packages/melos/lib/src/common/workspace_changelog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ class WorkspaceChangelog {
final MelosLogger logger;
final List<MelosPendingPackageUpdate> pendingPackageUpdates;

String get _changelogFileHeader {
return '# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n';
}
String get _changelogFileHeader => '''
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
''';

String _packageVersionTitle(MelosPendingPackageUpdate update) {
return '`${update.package.name}` - `v${update.nextVersion}`';
Expand Down Expand Up @@ -76,11 +79,12 @@ class WorkspaceChangelog {
body.writeln(' - There are no breaking changes in this release.');
} else {
for (final update in packagesWithBreakingChanges) {
body.writeln(
// ignore: missing_whitespace_between_adjacent_strings
' - [${_packageVersionTitle(update)}]'
'(${_packageVersionMarkdownAnchor(update)})',
body.write(' - ');
body.writeLink(
_packageVersionTitle(update),
uri: _packageVersionMarkdownAnchor(update),
);
body.writeln();
}
}
body.writeln();
Expand All @@ -90,11 +94,12 @@ class WorkspaceChangelog {
body.writeln(' - There are no other changes in this release.');
} else {
for (final update in packagesWithOtherChanges) {
body.writeln(
// ignore: missing_whitespace_between_adjacent_strings
' - [${_packageVersionTitle(update)}]'
'(${_packageVersionMarkdownAnchor(update)})',
body.write(' - ');
body.writeLink(
_packageVersionTitle(update),
uri: _packageVersionMarkdownAnchor(update),
);
body.writeln();
}
}
if (graduatedPackages.isNotEmpty) {
Expand All @@ -105,9 +110,7 @@ class WorkspaceChangelog {
);
body.writeln();
for (final update in graduatedPackages) {
body.writeln(
' - ${_packageVersionTitle(update)}',
);
body.writeln(' - ${_packageVersionTitle(update)}');
}
}
if (dependencyOnlyPackages.isNotEmpty) {
Expand All @@ -122,9 +125,7 @@ class WorkspaceChangelog {
);
body.writeln();
for (final update in dependencyOnlyPackages) {
body.writeln(
' - ${_packageVersionTitle(update)}',
);
body.writeln(' - ${_packageVersionTitle(update)}');
}
}
if (packagesWithOtherChanges.isNotEmpty ||
Expand Down
10 changes: 6 additions & 4 deletions packages/melos/lib/src/package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,9 @@ The packages that caused the problem are:
return _map[key];
}

/// Detect packages in the workspace with the provided filters. This is the
/// default packages behaviour when a workspace is loaded.
/// Detect packages in the workspace with the provided filters.
///
/// This is the default packages behaviour when a workspace is loaded.
Future<PackageMap> applyFilter(PackageFilter? filter) async {
if (filter == null) return this;

Expand Down Expand Up @@ -814,8 +815,9 @@ class Package {
return PackageType.dartPackage;
}

/// Returns whether this package is for Flutter. This is determined by whether
/// the package depends on the Flutter SDK.
/// Returns whether this package is for Flutter.
///
/// This is determined by whether the package depends on the Flutter SDK.
late final bool isFlutterPackage = dependencies.contains('flutter');

/// Returns whether this package is private (publish_to set to 'none').
Expand Down

0 comments on commit d9409f9

Please sign in to comment.