Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkgs/cli_config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 0.1.2-wip
## 0.1.2

- Add usage docs to the readme.
- Require Dart 3.0.

## 0.1.1

Expand Down
9 changes: 0 additions & 9 deletions pkgs/cli_config/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@ analyzer:

linter:
rules:
- always_declare_return_types
- avoid_dynamic_calls
- camel_case_types
- depend_on_referenced_packages
- directives_ordering
- prefer_const_declarations
- prefer_expression_function_bodies
- prefer_final_in_for_each
- prefer_final_locals
- prefer_relative_imports
- prefer_single_quotes
- sort_pub_dependencies
- unawaited_futures
8 changes: 4 additions & 4 deletions pkgs/cli_config/lib/src/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class Config {
/// finally the config file.
///
/// For cli defines and environment variables, the value must be parseble
/// by [int.parse].
/// by [core.int.parse].
/// For the config file, it must be an integer.
core.int int(String key) {
final value = optionalInt(key);
Expand All @@ -369,7 +369,7 @@ class Config {
/// finally the config file.
///
/// For cli defines and environment variables, the value must be parseble
/// by [int.parse].
/// by [core.int.parse].
/// For the config file, it must be an integer or null.
core.int? optionalInt(String key) {
core.int? value;
Expand All @@ -385,7 +385,7 @@ class Config {
/// finally the config file.
///
/// For cli defines and environment variables, the value must be parseble
/// by [double.parse].
/// by [core.double.parse].
/// For the config file, it must be an double.
core.double double(String key) {
final value = optionalDouble(key);
Expand All @@ -399,7 +399,7 @@ class Config {
/// finally the config file.
///
/// For cli defines and environment variables, the value must be parseble
/// by [double.parse].
/// by [core.double.parse].
/// For the config file, it must be an double or null.
core.double? optionalDouble(String key) {
core.double? value;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/cli_config/lib/src/environment_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'source.dart';
class EnvironmentSource extends Source {
/// Configuration options passed in via the [Platform.environment].
///
/// The keys have been transformed by [EnvironmentParser.parseKey].
/// The keys have been transformed by `EnvironmentParser.parseKey`.
///
/// Environment values are left intact.
///
Expand Down
3 changes: 2 additions & 1 deletion pkgs/cli_config/lib/src/file_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class FileParser {
sourceUrl: sourceUrl,
);
if (parsedYaml is! Map) {
throw FormatException('YAML config must be set of key value pairs.');
throw const FormatException(
'YAML config must be set of key value pairs.');
}
return parseToplevelMap(parsedYaml);
}
Expand Down
6 changes: 3 additions & 3 deletions pkgs/cli_config/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: cli_config
description: >-
A library to take config values from configuration files, CLI arguments, and
environment variables.
version: 0.1.2-wip
version: 0.1.2
repository: https://github.com/dart-lang/tools/tree/main/pkgs/cli_config

environment:
sdk: ">=2.19.3 <4.0.0"
sdk: ^3.0.0

dependencies:
args: ^2.4.0
yaml: ^3.1.1

dev_dependencies:
dart_flutter_team_lints: ^1.0.0
dart_flutter_team_lints: ^2.0.0
test: ^1.21.0