Skip to content

Commit

Permalink
Dart 3.4 requirement, fix lint rules and cleanup comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
renggli committed May 25, 2024
1 parent cd22ead commit ffa079f
Show file tree
Hide file tree
Showing 67 changed files with 448 additions and 414 deletions.
2 changes: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ linter:
- comment_references
- directives_ordering
- invalid_case_patterns
- missing_code_block_language_in_doc_comment
- no_self_assignments
- no_wildcard_variable_uses
- omit_local_variable_types
Expand All @@ -33,6 +34,7 @@ linter:
- unnecessary_await_in_return
- unnecessary_breaks
- unnecessary_lambdas
- unnecessary_library_name
- unnecessary_null_aware_operator_on_extension_on_nullable
- unnecessary_null_checks
- unnecessary_parenthesis
Expand Down
2 changes: 1 addition & 1 deletion bin/generate_tuple.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Future<void> generateExport() async {
generateWarning(out);

out.writeln('/// Tuple extension methods on generic records.');
out.writeln('library tuple;');
out.writeln('library;');
out.writeln();
out.writeln('export \'src/tuple/tuple.dart\';');
for (var i = 0; i < max; i++) {
Expand Down
18 changes: 9 additions & 9 deletions bin/generate_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Future<void> generateCallback() async {
generateWarning(out);

out.writeln('/// Function types for generic callbacks.');
out.writeln('library callback;');
out.writeln('library;');
out.writeln();

for (var i = 0; i < max; i++) {
Expand All @@ -35,7 +35,7 @@ Future<void> generateMapping() async {
generateWarning(out);

out.writeln('/// Function type for generic mapping functions.');
out.writeln('library mapping;');
out.writeln('library;');
out.writeln();

for (var i = 0; i < max; i++) {
Expand All @@ -56,7 +56,7 @@ Future<void> generatePredicate() async {
generateWarning(out);

out.writeln('/// Function type for generic predicate functions.');
out.writeln('library predicate;');
out.writeln('library;');
out.writeln();

for (var i = 0; i < max; i++) {
Expand All @@ -77,7 +77,7 @@ Future<void> generateEmpty() async {
generateWarning(out);

out.writeln('/// Generic empty functions returning nothing.');
out.writeln('library empty;');
out.writeln('library;');
out.writeln();

for (var i = 0; i < max; i++) {
Expand All @@ -98,7 +98,7 @@ Future<void> generateIdentity() async {
generateWarning(out);

out.writeln('/// Generic identity functions.');
out.writeln('library identity;');
out.writeln('library;');
out.writeln();

out.writeln('/// Generic identity function with 1 positional argument.');
Expand All @@ -115,7 +115,7 @@ Future<void> generateConstant() async {
generateWarning(out);

out.writeln('/// The constant functions.');
out.writeln('library constant;');
out.writeln('library;');
out.writeln();

out.writeln("import 'mapping.dart';");
Expand All @@ -141,7 +141,7 @@ Future<void> generateThrowing() async {
generateWarning(out);

out.writeln('/// The throwing functions.');
out.writeln('library throwing;');
out.writeln('library;');
out.writeln();

out.writeln("import 'mapping.dart';");
Expand Down Expand Up @@ -169,7 +169,7 @@ Future<void> generatePartial() async {

out.writeln('/// Binds positional arguments and returns a new function:');
out.writeln('/// https://en.wikipedia.org/wiki/Partial_application');
out.writeln('library partial;');
out.writeln('library;');
out.writeln();

out.writeln("import 'mapping.dart';");
Expand Down Expand Up @@ -211,7 +211,7 @@ Future<void> generateCurry() async {
'sequence of functions ');
out.writeln('/// taking a single argument: '
'https://en.wikipedia.org/wiki/Currying');
out.writeln('library curry;');
out.writeln('library;');
out.writeln();

out.writeln("import 'mapping.dart';");
Expand Down
2 changes: 1 addition & 1 deletion lib/async.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Helpers to make async code better.
library async;
library;

export 'src/async/buffer.dart' show BufferExtension;
export 'src/async/flat_map.dart' show FlatMapStreamExtension;
Expand Down
2 changes: 1 addition & 1 deletion lib/cache.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Collection of different caching strategies and their expiry policy.
library cache;
library;

export 'src/cache/cache.dart';
export 'src/cache/delegate.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/char_matcher.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// A first-class model of character classes, their composition and operations
/// on strings.
library char_matcher;
library;

export 'src/char_matcher/char_matcher.dart';
export 'src/char_matcher/unicode/unicode.dart';
2 changes: 1 addition & 1 deletion lib/collection.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// A collection of iterable extensions and new collection types: bi-map,
/// bit-list, multi-set, set and list multi-map, range, and string.
library collection;
library;

export 'src/collection/bimap.dart'
show BiMap, BiMapOnIterableExtension, BiMapOnMapExtension;
Expand Down
2 changes: 1 addition & 1 deletion lib/comparator.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Provides default [Comparator] constructors, and various static extension
/// methods to modify and perform common operations on [Comparator] functions.
library comparator;
library;

export 'src/comparator/compare_operators.dart';
export 'src/comparator/constructors/explicit.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/diff.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Port of Python's difflib library to Dart providing tools for comparing
/// lists.
library diff;
library;

export 'src/diff/close_matches.dart';
export 'src/diff/differ.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/feature.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Information about the runtime environment.
library feature;
library;

import 'dart:math';

Expand Down
2 changes: 1 addition & 1 deletion lib/functional.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// A collection of functional programming structures.
library functional;
library;

export 'src/functional/either.dart' show Either;
export 'src/functional/optional.dart' show Optional;
Expand Down
2 changes: 1 addition & 1 deletion lib/graph.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Graph-theory objects and algorithms.
library graph;
library;

export 'src/graph/algorithms.dart' show AlgorithmsGraphExtension;
export 'src/graph/algorithms/a_star_search.dart' show AStarSearchIterable;
Expand Down
2 changes: 1 addition & 1 deletion lib/interval.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Provides a continuous interval.
library interval;
library;

export 'src/interval/interval.dart' show Interval;
export 'src/interval/tree.dart' show IntervalTree;
2 changes: 1 addition & 1 deletion lib/math.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// A collection of common mathematical functions.
library math;
library;

export 'src/math/binomial.dart'
show BinomialBigIntExtension, BinomialIntegerExtension;
Expand Down
2 changes: 1 addition & 1 deletion lib/more.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// More Dart — Literally.
library more;
library;

export 'package:more/async.dart';
export 'package:more/cache.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/number.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Support for fractional and complex arithmetic.
library number;
library;

export 'src/number/bigint.dart' show BigIntExtension;
export 'src/number/complex.dart' show Complex;
Expand Down
2 changes: 1 addition & 1 deletion lib/printer.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Provides a first-class model to convert object to strings using composition
/// and highly configurable formatting primitives.
library printer;
library;

export 'src/printer/builder.dart' show BuilderPrinterExtension;
export 'src/printer/empty.dart' show EmptyPrinterExtension;
Expand Down
13 changes: 8 additions & 5 deletions lib/src/char_matcher/char_matcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,19 @@ import 'unicode/unicode.dart';
/// inclusion of a character can be determined by calling the char matcher with
/// the code-unit as the function argument, for example:
///
/// CharMatcher.whitespace().match(' '.runes.first); // true
/// CharMatcher.digit().match('a'.runes.first); // false
/// ```dart
/// CharMatcher.whitespace().match(' '.runes.first); // true
/// CharMatcher.digit().match('a'.runes.first); // false
/// ```
///
/// A large collection of helper methods let you perform string operations on
/// the occurrences of the specified class of characters: trimming, collapsing,
/// replacing, removing, retaining, etc. For example:
///
/// String withoutWhitespace = CharMatcher.whitespace().removeFrom(string);
/// String onlyDigits = CharMatcher.digit().retainFrom(string);
///
/// ```dart
/// String withoutWhitespace = CharMatcher.whitespace().removeFrom(string);
/// String onlyDigits = CharMatcher.digit().retainFrom(string);
/// ```
@immutable
abstract class CharMatcher with ToStringPrinter implements Pattern {
/// A matcher that accepts any character.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/char_matcher/unicode/category.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ const data = [
32, -4, 1, -2, 256, 64, -2, 256, -3, 1, -3, 256, 1, -3, 256, 64, -2, 1, 32,
-6, 1, 256, -14, 1, -10, 512, -3, 2048, -6, 134217728, 33554432, 134217728,
-5, 1, 64, -3, 256, 64, -8, 32, 1, -3, 32, 1, -23, 32, 1, -16, 32, -2, 1, 64,
32, -3, 64, -4, 256, 1, -3, 64, 1, -4, 64, -7, 1, -2, 64, 1, -3, 32, 1, -2,
32, -3, 64, -4, 256, 1, -3, 64, 1, -4, 64, -7, 1, -2, 64, 1, -3, 32, -2, 1,
32, -2, 1, -2, 32, -2, 64, -2, 1, -10, 512, -7, 1, 8388608, -7, 2048,
134217728, 32, 64, -2, 256, 8388608, -8, 32, 1, -3, 32, 1, -23, 32, 1, -10,
32, 1, -5, 32, -2, 1, 64, 32, 256, 64, -5, 256, 1, 64, -2, 256, 1, -2, 256,
-2, 64, -7, 1, -2, 256, -5, 1, -3, 32, 1, -2, 32, -2, 64, -2, 1, -10, 512, 1,
-2, 64, -7, 1, -2, 256, -6, 1, -2, 32, 1, -2, 32, -2, 64, -2, 1, -10, 512, 1,
-2, 32, 256, -12, 1, -2, 64, -2, 256, -9, 32, 1, -3, 32, 1, -41, 32, -2, 64,
32, -3, 256, -4, 64, 1, -3, 256, 1, -3, 256, 64, 32, 134217728, -4, 1, -3, 32,
256, -7, 2048, -3, 32, -2, 64, -2, 1, -10, 512, -9, 2048, 134217728, -6, 32,
Expand Down
Loading

0 comments on commit ffa079f

Please sign in to comment.