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

Commit

Permalink
Switch to package:lints (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
mit-mit authored May 25, 2021
1 parent 315d71a commit 2f28f25
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 1.1.1-dev

* Switched from using lints in package:pedantic to package:lints.

## 1.1.0

* Stable release for null safety.
Expand Down
8 changes: 1 addition & 7 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
include: package:pedantic/analysis_options.1.9.0.yaml
analyzer:
errors:
prefer_single_quotes: ignore
use_function_type_syntax_for_parameters: ignore
enable-experiment:
- non-nullable
include: package:lints/recommended.yaml
15 changes: 8 additions & 7 deletions lib/src/characters_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,14 @@ class StringCharacters extends Iterable<String> implements Characters {
}

@override
bool contains(Object? other) {
if (other is String) {
if (other.isEmpty) return false;
var next = Breaks(other, 0, other.length, stateSoTNoBreak).nextBreak();
if (next != other.length) return false;
// [other] is single grapheme cluster.
return _indexOf(string, other, 0, string.length) >= 0;
bool contains(Object? element) {
if (element is String) {
if (element.isEmpty) return false;
var next =
Breaks(element, 0, element.length, stateSoTNoBreak).nextBreak();
if (next != element.length) return false;
// [element] is single grapheme cluster.
return _indexOf(string, element, 0, string.length) >= 0;
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ environment:

dev_dependencies:
test: ^1.16.0
pedantic: ^1.10.0
lints: ^1.0.0
2 changes: 1 addition & 1 deletion test/characters_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void main([List<String>? args]) {
var zwj = "\u200d"; // U+200D, ZWJ
var rainbow = "\u{1f308}"; // U+1F308, Rainbow. Category Pictogram

testParts(gc("$flag$white$zwj$rainbow"), gc("$flag$white"), gc("$rainbow"),
testParts(gc("$flag$white$zwj$rainbow"), gc("$flag$white"), gc(rainbow),
gc("$flag$zwj$rainbow"), gc("!"));
});

Expand Down

0 comments on commit 2f28f25

Please sign in to comment.