Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion packages/custom_lint/lib/src/runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CustomLintRunner {

var _closed = false;

late final _sdkPath = getSdkPath();
late final _sdkPath = sdkPath;

/// Starts the plugin and sends the necessary requests for initializing it.
late final initialize = Future(() async {
Expand Down
12 changes: 3 additions & 9 deletions packages/custom_lint/lib/src/workspace.dart
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,6 @@ extension on Dependency {
PathDependency() => '"${that.path}"',
SdkDependency() => 'sdk: ${that.sdk}',
GitDependency() => 'git: ${that.url}',
_ => throw ArgumentError.value(
runtimeType,
'this',
'Unknown dependency type',
),
};
}
}
Expand Down Expand Up @@ -557,9 +552,8 @@ publish_to: 'none'
}

void _writeEnvironment(StringBuffer buffer) {
final environmentKeys = projects
.expand((e) => e.pubspec.environment?.keys ?? <String>[])
.toSet();
final environmentKeys =
projects.expand((e) => e.pubspec.environment.keys).toSet();

if (environmentKeys.isEmpty) return;

Expand All @@ -568,7 +562,7 @@ publish_to: 'none'
for (final key in environmentKeys) {
final projectMeta = projects
.map((project) {
final constraint = project.pubspec.environment?[key];
final constraint = project.pubspec.environment[key];
if (constraint == null) return null;
return (project: project, constraint: constraint);
})
Expand Down
4 changes: 2 additions & 2 deletions packages/custom_lint/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
args: ^2.3.1
async: ^2.9.0
ci: ^0.1.0
cli_util: ^0.4.0
cli_util: ^0.4.2
collection: ^1.16.0
custom_lint_core: 0.7.0
freezed_annotation: ^2.2.0
Expand All @@ -22,7 +22,7 @@ dependencies:
package_config: ^2.0.2
path: ^1.8.0
pub_semver: ^2.1.1
pubspec_parse: ^1.2.0
pubspec_parse: ^1.4.0
rxdart: ^0.28.0
uuid: ">=3.0.6 <5.0.0"
yaml: ^3.1.1
Expand Down
9 changes: 4 additions & 5 deletions packages/custom_lint/test/src/workspace_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,10 @@ extension on Pubspec {
return {
'name': name,
if (version != null) 'version': version.toString(),
if (environment != null)
'environment': {
for (final env in environment!.entries)
if (env.value != null) env.key: env.value.toString(),
},
'environment': {
for (final env in environment.entries)
if (env.value != null) env.key: env.value.toString(),
},
if (dependencies.isNotEmpty)
'dependencies': {
for (final dependency in dependencies.entries)
Expand Down
Loading