Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dev dependencies to the latest version #1795

Merged
merged 7 commits into from Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions analysis/lib/analysis_options.yaml
Expand Up @@ -11,16 +11,13 @@ analyzer:
# These are necessary for matching the JS API.
avoid_types_as_parameter_names: ignore

# This has tons of false positives for StreamSubscription.close().
unawaited_futures: ignore

# These are style preferences rather than potential semantic issues. While
# we're not intrinsically opposed to adopting them for consistency with the
# Dart ecosystem, there aren't currently any automated tools to help us
# migrate to and remain consistent with these style rules, so achieving
# consistency isn't worth the engineering time we'd spend getting there.
annotate_overrides: ignore
prefer_single_quotes: ignore
use_function_type_syntax_for_parameters: ignore
prefer_interpolation_to_compose_strings: ignore

include: package:lints/recommended.yaml
4 changes: 2 additions & 2 deletions analysis/pubspec.yaml
Expand Up @@ -6,7 +6,7 @@ homepage: https://github.com/sass/dart-sass/tree/master/analysis
publish_to: none

environment:
sdk: ">=2.0.0 <3.0.0"
sdk: ">=2.17.0 <3.0.0"

dependencies:
lints: ^1.0.0
lints: ^2.0.0
4 changes: 2 additions & 2 deletions lib/src/callable.dart
Expand Up @@ -10,8 +10,8 @@ import 'exception.dart';
import 'value.dart';

export 'callable/async.dart';
export 'callable/async_built_in.dart';
export 'callable/built_in.dart';
export 'callable/async_built_in.dart' show AsyncBuiltInCallable;
export 'callable/built_in.dart' show BuiltInCallable;
export 'callable/plain_css.dart';
export 'callable/user_defined.dart';

Expand Down
6 changes: 3 additions & 3 deletions lib/src/callable/async_built_in.dart
Expand Up @@ -11,7 +11,7 @@ import '../value.dart';
import 'async.dart';

/// An [AsyncBuiltInCallable]'s callback.
typedef _Callback = FutureOr<Value> Function(List<Value> arguments);
typedef Callback = FutureOr<Value> Function(List<Value> arguments);

/// A callable defined in Dart code.
///
Expand All @@ -26,7 +26,7 @@ class AsyncBuiltInCallable implements AsyncCallable {
final ArgumentDeclaration _arguments;

/// The callback to run when executing this callable.
final _Callback _callback;
final Callback _callback;

/// Creates a function with a single [arguments] declaration and a single
/// [callback].
Expand Down Expand Up @@ -76,7 +76,7 @@ class AsyncBuiltInCallable implements AsyncCallable {
/// If no exact match is found, finds the closest approximation. Note that this
/// doesn't guarantee that [positional] and [names] are valid for the returned
/// [ArgumentDeclaration].
Tuple2<ArgumentDeclaration, _Callback> callbackFor(
Tuple2<ArgumentDeclaration, Callback> callbackFor(
int positional, Set<String> names) =>
Tuple2(_arguments, _callback);
}
10 changes: 5 additions & 5 deletions lib/src/callable/built_in.dart
Expand Up @@ -8,7 +8,7 @@ import '../ast/sass.dart';
import '../callable.dart';
import '../value.dart';

typedef _Callback = Value Function(List<Value> arguments);
typedef Callback = Value Function(List<Value> arguments);

/// A callable defined in Dart code.
///
Expand All @@ -20,7 +20,7 @@ class BuiltInCallable implements Callable, AsyncBuiltInCallable {
final String name;

/// The overloads declared for this callable.
final List<Tuple2<ArgumentDeclaration, _Callback>> _overloads;
final List<Tuple2<ArgumentDeclaration, Callback>> _overloads;

/// Creates a function with a single [arguments] declaration and a single
/// [callback].
Expand Down Expand Up @@ -73,7 +73,7 @@ class BuiltInCallable implements Callable, AsyncBuiltInCallable {
/// If passed, [url] is the URL of the module in which the function is
/// defined.
BuiltInCallable.overloadedFunction(
this.name, Map<String, _Callback> overloads,
this.name, Map<String, Callback> overloads,
{Object? url})
: _overloads = [
for (var entry in overloads.entries)
Expand All @@ -91,9 +91,9 @@ class BuiltInCallable implements Callable, AsyncBuiltInCallable {
/// If no exact match is found, finds the closest approximation. Note that this
/// doesn't guarantee that [positional] and [names] are valid for the returned
/// [ArgumentDeclaration].
Tuple2<ArgumentDeclaration, _Callback> callbackFor(
Tuple2<ArgumentDeclaration, Callback> callbackFor(
int positional, Set<String> names) {
Tuple2<ArgumentDeclaration, _Callback>? fuzzyMatch;
Tuple2<ArgumentDeclaration, Callback>? fuzzyMatch;
int? minMismatchDistance;

for (var overload in _overloads) {
Expand Down
6 changes: 3 additions & 3 deletions lib/src/functions/map.dart
Expand Up @@ -170,7 +170,7 @@ final _hasKey = _function("has-key", r"$map, $key, $keys...", (arguments) {
Value _modify(SassMap map, Iterable<Value> keys, Value modify(Value old),
{bool addNesting = true}) {
var keyIterator = keys.iterator;
SassMap _modifyNestedMap(SassMap map) {
SassMap modifyNestedMap(SassMap map) {
var mutableMap = Map.of(map.contents);
var key = keyIterator.current;

Expand All @@ -182,11 +182,11 @@ Value _modify(SassMap map, Iterable<Value> keys, Value modify(Value old),
var nestedMap = mutableMap[key]?.tryMap();
if (nestedMap == null && !addNesting) return SassMap(mutableMap);

mutableMap[key] = _modifyNestedMap(nestedMap ?? const SassMap.empty());
mutableMap[key] = modifyNestedMap(nestedMap ?? const SassMap.empty());
return SassMap(mutableMap);
}

return keyIterator.moveNext() ? _modifyNestedMap(map) : modify(map);
return keyIterator.moveNext() ? modifyNestedMap(map) : modify(map);
}

/// Merges [map1] and [map2], with values in [map2] taking precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils.dart
Expand Up @@ -455,7 +455,7 @@ extension MapExtension<K, V> on Map<K, V> {
/// [key] to the result.
V putOrMerge(K key, V value, V Function(V oldValue, V newValue) merge) =>
containsKey(key)
? this[key] = merge(this[key]!, value)
? this[key] = merge(this[key] as V, value)
: this[key] = value;
}

Expand Down
8 changes: 4 additions & 4 deletions lib/src/value/number.dart
Expand Up @@ -593,7 +593,7 @@ abstract class SassNumber extends Value {
var otherHasUnits = newNumerators.isNotEmpty || newDenominators.isNotEmpty;
if (coerceUnitless && (!hasUnits || !otherHasUnits)) return this.value;

SassScriptException _compatibilityException() {
SassScriptException compatibilityException() {
if (other != null) {
var message = StringBuffer("$this and");
if (otherName != null) message.write(" \$$otherName:");
Expand Down Expand Up @@ -634,7 +634,7 @@ abstract class SassNumber extends Value {
if (factor == null) return false;
value *= factor;
return true;
}, orElse: () => throw _compatibilityException());
}, orElse: () => throw compatibilityException());
}

var oldDenominators = denominatorUnits.toList();
Expand All @@ -644,11 +644,11 @@ abstract class SassNumber extends Value {
if (factor == null) return false;
value /= factor;
return true;
}, orElse: () => throw _compatibilityException());
}, orElse: () => throw compatibilityException());
}

if (oldNumerators.isNotEmpty || oldDenominators.isNotEmpty) {
throw _compatibilityException();
throw compatibilityException();
}

return value;
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Expand Up @@ -32,15 +32,15 @@ dependencies:
http: ^0.13.3

dev_dependencies:
analyzer: ^3.0.0
analyzer: ^4.7.0
archive: ^3.1.2
cli_pkg: ^2.1.4
crypto: ^3.0.0
dart_style: ^2.0.0
dartdoc: ^5.0.0
dartdoc: ^6.0.0
grinder: ^0.9.0
node_preamble: ^2.0.0
lints: ^1.0.0
lints: ^2.0.0
pub_api_client: ^2.1.1
pub_semver: ^2.0.0
pubspec_parse: ^1.0.0
Expand Down
4 changes: 2 additions & 2 deletions tool/grind/synchronize.dart
Expand Up @@ -128,7 +128,7 @@ class _Visitor extends RecursiveAstVisitor<void> {
}

void visitClassDeclaration(ClassDeclaration node) {
if (_sharedClasses.contains(node.name.name)) {
if (_sharedClasses.contains(node.name2.lexeme)) {
_skipNode(node);
} else {
super.visitClassDeclaration(node);
Expand All @@ -141,7 +141,7 @@ class _Visitor extends RecursiveAstVisitor<void> {
}

void visitMethodDeclaration(MethodDeclaration node) {
if (_synchronizeName(node.name.name) != node.name.name) {
if (_synchronizeName(node.name2.lexeme) != node.name2.lexeme) {
// If the file defines any asynchronous versions of synchronous functions,
// remove them.
_skipNode(node);
Expand Down