Skip to content

Commit

Permalink
Regexp fix to unbork check in LibraryNames.
Browse files Browse the repository at this point in the history
See flutter/flutter#1996 for context.

Net-net, `pointycastle.impl.ec_domain_parameters.gostr3410_2001_cryptopro_a` was killing our previous regexp.

Kudos to Bob and Natalie for their regexp-fu!

BUG=
R=rnystrom@google.com

Review URL: https://codereview.chromium.org//1719553002 .
  • Loading branch information
pq committed Feb 20, 2016
1 parent f0d8b3a commit ce7aa0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/src/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final _lowerCamelCase = new RegExp(r'^[_]?[a-z][a-z0-9]*([A-Z][a-z0-9]*)*$');
final _lowerCaseUnderScore = new RegExp(r'^([a-z]+([_]?[a-z0-9]+)*)+$');

final _lowerCaseUnderScoreWithDots =
new RegExp(r'^([a-z]+([_]?[a-z0-9]+)?)+(.([a-z]+([_]?[a-z0-9]+)?))*$');
new RegExp(r'^[a-z][_a-z0-9]*(\.[a-z][_a-z0-9]*)*$');

final _pubspec = new RegExp(r'^[_]?pubspec\.yaml$');

Expand Down
4 changes: 3 additions & 1 deletion test/rule_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ defineRuleUnitTests() {
'foo.bar',
'foo_bar_baz',
'foo',
'foo_',
'foo.bar_baz.bang',
//See: https://github.com/flutter/flutter/pull/1996
'pointycastle.impl.ec_domain_parameters.gostr3410_2001_cryptopro_a',
'a.b',
'a.b.c',
'p2.src.acme'
Expand All @@ -189,7 +192,6 @@ defineRuleUnitTests() {
'Foo',
'fooBar.',
'.foo_Bar',
'foo_',
'_f',
'F_B',
'JS',
Expand Down

0 comments on commit ce7aa0e

Please sign in to comment.