Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
Fix deprecated import to webdriver library
Browse files Browse the repository at this point in the history
Bump pgk:lints, cleanup duplicative lints
Bump min SDK
  • Loading branch information
kevmoo committed Jan 25, 2023
1 parent be426a2 commit 8d75d45
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 73 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.1.3-dev

- Update the minimum Dart SDK version to `2.18.0`.

## 4.1.2

- Send `fetch` requests instead of `XHR` requests.
Expand Down
58 changes: 1 addition & 57 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,85 +1,29 @@
# https://dart.dev/guides/language/analysis-options
include: package:lints/recommended.yaml

analyzer:
language:
strict-casts: true
errors:
dead_code: error
unused_element: error
unused_import: error
unused_local_variable: error

linter:
rules:
- always_declare_return_types
- annotate_overrides
- avoid_empty_else
- avoid_function_literals_in_foreach_calls
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null
- avoid_types_as_parameter_names
- avoid_unused_constructor_parameters
- await_only_futures
- camel_case_types
- cancel_subscriptions
#- cascade_invocations
- comment_references
- constant_identifier_names
- control_flow_in_finally
- directives_ordering
- empty_catches
- empty_constructor_bodies
- empty_statements
- hash_and_equals
- implementation_imports
- iterable_contains_unrelated_type
- library_names
- library_prefixes
- list_remove_unrelated_type
- literal_only_boolean_expressions
- no_adjacent_strings_in_list
- no_duplicate_case_values
- non_constant_identifier_names
- null_closures
- omit_local_variable_types
- only_throw_errors
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
#- prefer_final_locals
- prefer_generic_function_type_aliases
- prefer_initializing_formals
- prefer_interpolation_to_compose_strings
- prefer_is_empty
- prefer_is_not_empty
- prefer_single_quotes
- prefer_typing_uninitialized_variables
- recursive_getters
- slash_for_doc_comments
- test_types_in_equals
- throw_in_finally
- type_init_formals
- unawaited_futures
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_lambdas
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_statements
- unnecessary_this
- unrelated_type_equality_checks
- use_rethrow_when_possible
- valid_regexps
18 changes: 9 additions & 9 deletions lib/src/util/uuid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ import 'dart:math' show Random;
String generateUuidV4() {
final random = Random();

int _generateBits(int bitCount) => random.nextInt(1 << bitCount);
int generateBits(int bitCount) => random.nextInt(1 << bitCount);

String _printDigits(int value, int count) =>
String printDigits(int value, int count) =>
value.toRadixString(16).padLeft(count, '0');
String _bitsDigits(int bitCount, int digitCount) =>
_printDigits(_generateBits(bitCount), digitCount);
String bitsDigits(int bitCount, int digitCount) =>
printDigits(generateBits(bitCount), digitCount);

// Generate xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx / 8-4-4-4-12.
var special = 8 + random.nextInt(4);

return '${_bitsDigits(16, 4)}${_bitsDigits(16, 4)}-'
'${_bitsDigits(16, 4)}-'
'4${_bitsDigits(12, 3)}-'
'${_printDigits(special, 1)}${_bitsDigits(12, 3)}-'
'${_bitsDigits(16, 4)}${_bitsDigits(16, 4)}${_bitsDigits(16, 4)}';
return '${bitsDigits(16, 4)}${bitsDigits(16, 4)}-'
'${bitsDigits(16, 4)}-'
'4${bitsDigits(12, 3)}-'
'${printDigits(special, 1)}${bitsDigits(12, 3)}-'
'${bitsDigits(16, 4)}${bitsDigits(16, 4)}${bitsDigits(16, 4)}';
}
12 changes: 6 additions & 6 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: sse
version: 4.1.2
version: 4.1.3-dev
description: >-
Provides client and server functionality for setting up bi-directional
communication through Server Sent Events (SSE) and corresponding POST
requests.
repository: https://github.com/dart-lang/sse

environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.18.0 <3.0.0'

dependencies:
async: ^2.0.8
collection: ^1.0.0
js: ^0.6.4
logging: '>=0.11.3+2 <2.0.0'
logging: ^1.0.0
pool: ^1.5.0
shelf: ^1.1.0
stream_channel: '>=1.6.8 <3.0.0'
stream_channel: ^2.0.0

dev_dependencies:
lints: ^1.0.0
shelf_static: '>=0.2.8 <2.0.0'
lints: ^2.0.0
shelf_static: ^1.0.0
test: ^1.5.3
webdriver: ^3.0.0
2 changes: 1 addition & 1 deletion test/sse_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:shelf_static/shelf_static.dart';
import 'package:sse/server/sse_handler.dart';
import 'package:sse/src/server/sse_handler.dart' show closeSink;
import 'package:test/test.dart';
import 'package:webdriver/io.dart';
import 'package:webdriver/async_io.dart';

void main() {
late HttpServer server;
Expand Down

0 comments on commit 8d75d45

Please sign in to comment.