Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 3c59297

Browse files
author
Michael Klimushyn
authored
[connectivity] Lint for public DartDocs (#2269)
Missing DartDocs were recently added to this plugin. Add a package-specific analysis options to make sure that they don't regress going forward.
1 parent e87ef4c commit 3c59297

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

packages/connectivity/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.5+5
2+
3+
* Add an analyzer check for the public documentation.
4+
15
## 0.4.5+4
26

37
* Stability and Maintainability: update documentations.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This exists to add a lint for missing API docs just on this specific package,
2+
# since not all packages have coverage for all their public members yet and
3+
# adding it in would be non-trivial. `public_member_api_docs` should be applied
4+
# to new packages going forward, and ideally the main `analysis_options.yaml`
5+
# file as soon as possible.
6+
7+
include: ../../analysis_options.yaml
8+
9+
linter:
10+
rules:
11+
- public_member_api_docs

packages/connectivity/example/lib/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// ignore_for_file: public_member_api_docs
6+
57
import 'dart:async';
68
import 'dart:io';
79

packages/connectivity/lib/connectivity.dart

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ import 'dart:io';
88
import 'package:flutter/services.dart';
99
import 'package:meta/meta.dart';
1010

11-
/// Connection Status Check Result
12-
///
13-
/// WiFi: Device connected via Wi-Fi
14-
/// Mobile: Device connected to cellular network
15-
/// None: Device not connected to any network
16-
enum ConnectivityResult { wifi, mobile, none }
11+
/// Connection status check result.
12+
enum ConnectivityResult {
13+
/// WiFi: Device connected via Wi-Fi
14+
wifi,
15+
16+
/// Mobile: Device connected to cellular network
17+
mobile,
18+
19+
/// None: Device not connected to any network
20+
none
21+
}
1722

1823
/// Discover network connectivity configurations: Distinguish between WI-FI and cellular, check WI-FI status and more.
1924
class Connectivity {

packages/connectivity/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for discovering the state of the network (WiFi &
33
mobile/cellular) connectivity on Android and iOS.
44
author: Flutter Team <[email protected]>
55
homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity
6-
version: 0.4.5+4
6+
version: 0.4.5+5
77

88
flutter:
99
plugin:

0 commit comments

Comments
 (0)