Fixed a few lints (#297)

diff --git a/protobuf/analysis_options.yaml b/protobuf/analysis_options.yaml
new file mode 100644
index 0000000..108d105
--- /dev/null
+++ b/protobuf/analysis_options.yaml
@@ -0,0 +1 @@
+include: package:pedantic/analysis_options.yaml
diff --git a/protobuf/lib/src/protobuf/extension_registry.dart b/protobuf/lib/src/protobuf/extension_registry.dart
index 44ca3b7..b4bbab4 100644
--- a/protobuf/lib/src/protobuf/extension_registry.dart
+++ b/protobuf/lib/src/protobuf/extension_registry.dart
@@ -118,7 +118,7 @@
       }
     });
 
-    if (codedBufferWriter.toBuffer().length > 0) {
+    if (codedBufferWriter.toBuffer().isNotEmpty) {
       ensureResult()
           .mergeFromBuffer(codedBufferWriter.toBuffer(), extensionRegistry);
     }
diff --git a/protobuf/lib/src/protobuf/field_set.dart b/protobuf/lib/src/protobuf/field_set.dart
index d45a97e..04256f1 100644
--- a/protobuf/lib/src/protobuf/field_set.dart
+++ b/protobuf/lib/src/protobuf/field_set.dart
@@ -207,9 +207,10 @@
   Map<K, V> _getDefaultMap<K, V>(MapFieldInfo<K, V> fi) {
     assert(fi.isMapField);
 
-    if (_isReadOnly)
+    if (_isReadOnly) {
       return PbMap<K, V>.unmodifiable(PbMap<K, V>(
           fi.keyFieldType, fi.valueFieldType, fi.mapEntryBuilderInfo));
+    }
 
     var value = fi._createMapField(_message);
     _setNonExtensionFieldUnchecked(fi, value);
diff --git a/protobuf/lib/src/protobuf/mixins/well_known.dart b/protobuf/lib/src/protobuf/mixins/well_known.dart
index e77a8ad..2114680 100644
--- a/protobuf/lib/src/protobuf/mixins/well_known.dart
+++ b/protobuf/lib/src/protobuf/mixins/well_known.dart
@@ -81,9 +81,10 @@
       GeneratedMessage message, TypeRegistry typeRegistry) {
     AnyMixin any = message as AnyMixin;
     BuilderInfo info = typeRegistry.lookup(_typeNameFromUrl(any.typeUrl));
-    if (info == null)
+    if (info == null) {
       throw ArgumentError(
           'The type of the Any message (${any.typeUrl}) is not in the given typeRegistry.');
+    }
     GeneratedMessage unpacked = info.createEmptyInstance()
       ..mergeFromBuffer(any.value);
     Object proto3Json = unpacked.toProto3Json();
@@ -152,7 +153,7 @@
   ///
   /// The result is in UTC time zone and has microsecond precision, as
   /// [DateTime] does not support nanosecond precision.
-  DateTime toDateTime() => new DateTime.fromMicrosecondsSinceEpoch(
+  DateTime toDateTime() => DateTime.fromMicrosecondsSinceEpoch(
       seconds.toInt() * Duration.microsecondsPerSecond + nanos ~/ 1000,
       isUtc: true);
 
@@ -470,7 +471,7 @@
       GeneratedMessage message, TypeRegistry typeRegistry) {
     FieldMaskMixin fieldMask = message as FieldMaskMixin;
     for (String path in fieldMask.paths) {
-      if (path.indexOf(RegExp('[A-Z]|_[^a-z]')) != -1) {
+      if (path.contains(RegExp('[A-Z]|_[^a-z]'))) {
         throw ArgumentError(
             'Bad fieldmask $path. Does not round-trip to json.');
       }
@@ -481,7 +482,7 @@
   static void fromProto3JsonHelper(GeneratedMessage message, Object json,
       TypeRegistry typeRegistry, JsonParsingContext context) {
     if (json is String) {
-      if (json.indexOf('_') != -1) {
+      if (json.contains('_')) {
         throw context.parseException(
             'Invalid Character `_` in FieldMask', json);
       }
diff --git a/protobuf/lib/src/protobuf/pb_list.dart b/protobuf/lib/src/protobuf/pb_list.dart
index 9282392..fcd0569 100644
--- a/protobuf/lib/src/protobuf/pb_list.dart
+++ b/protobuf/lib/src/protobuf/pb_list.dart
@@ -156,7 +156,7 @@
   final List<E> _wrappedList;
   final CheckFunc<E> check;
 
-  PbListBase._(this._wrappedList, {this.check = _checkNotNull}) {}
+  PbListBase._(this._wrappedList, {this.check = _checkNotNull});
 
   PbListBase._noList({this.check = _checkNotNull}) : _wrappedList = <E>[] {
     assert(check != null);
diff --git a/protobuf/lib/src/protobuf/pb_map.dart b/protobuf/lib/src/protobuf/pb_map.dart
index 79a44f5..e7b02ee 100644
--- a/protobuf/lib/src/protobuf/pb_map.dart
+++ b/protobuf/lib/src/protobuf/pb_map.dart
@@ -32,8 +32,9 @@
 
   @override
   void operator []=(K key, V value) {
-    if (_isReadonly)
+    if (_isReadonly) {
       throw UnsupportedError('Attempted to change a read-only map field');
+    }
     _checkNotNull(key);
     _checkNotNull(value);
     _wrappedMap[key] = value;
@@ -75,8 +76,9 @@
 
   @override
   void clear() {
-    if (_isReadonly)
+    if (_isReadonly) {
       throw UnsupportedError('Attempted to change a read-only map field');
+    }
     _wrappedMap.clear();
   }
 
@@ -85,8 +87,9 @@
 
   @override
   V remove(Object key) {
-    if (_isReadonly)
+    if (_isReadonly) {
       throw UnsupportedError('Attempted to change a read-only map field');
+    }
     return _wrappedMap.remove(key);
   }
 
diff --git a/protobuf/lib/src/protobuf/proto3_json.dart b/protobuf/lib/src/protobuf/proto3_json.dart
index 07581f2..8f08cd0 100644
--- a/protobuf/lib/src/protobuf/proto3_json.dart
+++ b/protobuf/lib/src/protobuf/proto3_json.dart
@@ -223,7 +223,6 @@
           return check32BitUnsigned(result);
         case PbFieldType._INT32_BIT:
         case PbFieldType._SINT32_BIT:
-        case PbFieldType._UINT32_BIT:
         case PbFieldType._FIXED32_BIT:
         case PbFieldType._SFIXED32_BIT:
           int result;
diff --git a/protobuf/lib/src/protobuf/unknown_field_set.dart b/protobuf/lib/src/protobuf/unknown_field_set.dart
index 6bfffff..a136f36 100644
--- a/protobuf/lib/src/protobuf/unknown_field_set.dart
+++ b/protobuf/lib/src/protobuf/unknown_field_set.dart
@@ -185,8 +185,9 @@
   }
 
   void _ensureWritable(String methodName) {
-    if (_isReadOnly)
+    if (_isReadOnly) {
       frozenMessageModificationHandler('UnknownFieldSet', methodName);
+    }
   }
 }
 
diff --git a/protobuf/lib/src/protobuf/utils.dart b/protobuf/lib/src/protobuf/utils.dart
index 2692d5d..d2af1fb 100644
--- a/protobuf/lib/src/protobuf/utils.dart
+++ b/protobuf/lib/src/protobuf/utils.dart
@@ -37,9 +37,9 @@
 
 @Deprecated("This function was not intended to be public. "
     "It will be removed from the public api in next major version. ")
-List<T> sorted<T>(Iterable<T> list) => new List.from(list)..sort();
+List<T> sorted<T>(Iterable<T> list) => List.from(list)..sort();
 
-List<T> _sorted<T>(Iterable<T> list) => new List.from(list)..sort();
+List<T> _sorted<T>(Iterable<T> list) => List.from(list)..sort();
 
 class _HashUtils {
 // Jenkins hash functions copied from https://github.com/google/quiver-dart/blob/master/lib/src/core/hash.dart.
diff --git a/protobuf/pubspec.yaml b/protobuf/pubspec.yaml
index d3ced8c..a862d03 100644
--- a/protobuf/pubspec.yaml
+++ b/protobuf/pubspec.yaml
@@ -16,3 +16,4 @@
   test: '>=1.2.0'
   benchmark_harness: any
   js: any
+  pedantic: ^1.0.0