From 93e957f9637e52ad208319b236b96fb19f2924b3 Mon Sep 17 00:00:00 2001 From: eggnstone Date: Sat, 14 Sep 2024 16:18:33 +0200 Subject: [PATCH] v1.1.23: Added experimental setting "Fix spaces". --- CHANGELOG.md | 4 ++-- lib/src/Constants/Generated/VersionConstants.dart | 2 +- lib/src/Data/Config.dart | 2 +- lib/src/Data/Config.freezed.dart | 3 ++- lib/src/Data/Config.g.dart | 2 +- pubspec.yaml | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c06806..8f9f558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Changelog -## 1.1.22 +## 1.1.23 -- Added experimental setting "Fix spaces". +- Added experimental setting "Fix spaces". ## 1.1.21 diff --git a/lib/src/Constants/Generated/VersionConstants.dart b/lib/src/Constants/Generated/VersionConstants.dart index 75752e9..05239fc 100644 --- a/lib/src/Constants/Generated/VersionConstants.dart +++ b/lib/src/Constants/Generated/VersionConstants.dart @@ -4,7 +4,7 @@ class VersionConstants { static const int MAJOR = 1; static const int MINOR = 1; - static const int PATCH = 22; + static const int PATCH = 23; static const Version VERSION = Version(MAJOR, MINOR, PATCH); } diff --git a/lib/src/Data/Config.dart b/lib/src/Data/Config.dart index f822c7c..d15830e 100644 --- a/lib/src/Data/Config.dart +++ b/lib/src/Data/Config.dart @@ -85,7 +85,7 @@ class Config with _$Config /// Whether to add a new line before an opening brace. required bool addNewLineBeforeOpeningBrace, /// Whether to fix spaces. - required bool fixSpaces, + @Default(false) required bool fixSpaces, /// The number of spaces to use for indentation. -1 = do not change indentation. required int indentationSpacesPerLevel, /// The maximum number of empty lines to allow. -1 = do not change empty lines. diff --git a/lib/src/Data/Config.freezed.dart b/lib/src/Data/Config.freezed.dart index 041a8de..820ac43 100644 --- a/lib/src/Data/Config.freezed.dart +++ b/lib/src/Data/Config.freezed.dart @@ -248,7 +248,7 @@ class _$ConfigImpl extends _Config { required this.addNewLineAtEndOfText, required this.addNewLineBeforeClosingBrace, required this.addNewLineBeforeOpeningBrace, - required this.fixSpaces, + required this.fixSpaces = false, required this.indentationSpacesPerLevel, required this.maxEmptyLines, required this.removeTrailingCommas}) @@ -283,6 +283,7 @@ class _$ConfigImpl extends _Config { /// Whether to fix spaces. @override + @JsonKey() final bool fixSpaces; /// The number of spaces to use for indentation. -1 = do not change indentation. diff --git a/lib/src/Data/Config.g.dart b/lib/src/Data/Config.g.dart index f9d130a..e7c9c53 100644 --- a/lib/src/Data/Config.g.dart +++ b/lib/src/Data/Config.g.dart @@ -15,7 +15,7 @@ _$ConfigImpl _$$ConfigImplFromJson(Map json) => _$ConfigImpl( json['AddNewLineBeforeClosingBrace'] as bool, addNewLineBeforeOpeningBrace: json['AddNewLineBeforeOpeningBrace'] as bool, - fixSpaces: json['FixSpaces'] as bool, + fixSpaces: json['FixSpaces'] as bool? ?? false, indentationSpacesPerLevel: (json['IndentationSpacesPerLevel'] as num).toInt(), maxEmptyLines: (json['MaxEmptyLines'] as num).toInt(), diff --git a/pubspec.yaml b/pubspec.yaml index e09a99b..14a19e7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: dart_format description: A formatter for Dart. Like dartfmt. But better ;) Because it's configurable. homepage: https://github.com/eggnstone/dart_format -version: 1.1.22 +version: 1.1.23 topics: - code-style - formatting