Skip to content

Commit 8126a41

Browse files
committed
Ran dart format across the project.
1 parent 801fcf3 commit 8126a41

File tree

3 files changed

+17
-26
lines changed

3 files changed

+17
-26
lines changed

lib/src/installer/completion_installation.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,15 @@ class CompletionInstallation {
274274
);
275275
}
276276

277-
278277
final _missingFiles = <String>[];
279278
String? __shellRCFilePath;
280279
String get _shellRCFilePath {
281280
String? firstPath;
282-
if(__shellRCFilePath == null){
283-
for(final fileName in configuration!.shellRCFiles){
281+
if (__shellRCFilePath == null) {
282+
for (final fileName in configuration!.shellRCFiles) {
284283
final filePath = _resolveHome(fileName, environment);
285284
firstPath ??= filePath;
286-
if(File(filePath).existsSync()){
285+
if (File(filePath).existsSync()) {
287286
__shellRCFilePath = filePath;
288287
return __shellRCFilePath!;
289288
}
@@ -308,10 +307,11 @@ class CompletionInstallation {
308307
final shellRCFile = File(_shellRCFilePath);
309308
if (!shellRCFile.existsSync()) {
310309
var message = '';
311-
if(_missingFiles.length > 1){
312-
message = 'No configuration files where found at '
313-
'\n ${_missingFiles.join('\n ')}';
314-
}else{
310+
if (_missingFiles.length > 1) {
311+
message =
312+
'No configuration files where found at '
313+
'\n ${_missingFiles.join('\n ')}';
314+
} else {
315315
message = 'No configuration file found at ${shellRCFile.path}';
316316
}
317317
throw CompletionInstallationException(

lib/src/installer/shell_completion_configuration.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fi
9797
@visibleForTesting
9898
final bashConfiguration = ShellCompletionConfiguration._(
9999
shell: SystemShell.bash,
100-
shellRCFiles: const ['~/.bashrc','~/.bash_profile'],
100+
shellRCFiles: const ['~/.bashrc', '~/.bash_profile'],
101101
sourceLineTemplate: (String scriptPath) {
102102
return '[ -f $scriptPath ] && . $scriptPath || true';
103103
},

test/src/installer/completion_installation_test.dart

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,7 @@ void main() {
730730

731731
test(
732732
'installing completion for .bashrc',
733-
() {
734-
733+
() {
735734
final bashInstallation = CompletionInstallation(
736735
logger: logger,
737736
isWindows: false,
@@ -746,8 +745,7 @@ void main() {
746745
final bashProfile = File(path.join(tempDir.path, '.bash_profile'))
747746
..createSync();
748747

749-
bashInstallation
750-
.install('very_good');
748+
bashInstallation.install('very_good');
751749

752750
// Different format needed for matching cli output
753751
expect(bashProfile.readAsStringSync(), '''
@@ -757,14 +755,12 @@ void main() {
757755
## [/Completion]
758756
759757
''');
760-
761758
},
762759
);
763760

764761
test(
765762
'installing completion for .bash_profile',
766-
() {
767-
763+
() {
768764
final bashInstallation = CompletionInstallation(
769765
logger: logger,
770766
isWindows: false,
@@ -776,11 +772,9 @@ void main() {
776772

777773
final configDir = bashInstallation.completionConfigDir;
778774

779-
final bashRc = File(path.join(tempDir.path, '.bashrc'))
780-
..createSync();
775+
final bashRc = File(path.join(tempDir.path, '.bashrc'))..createSync();
781776

782-
bashInstallation
783-
.install('very_good');
777+
bashInstallation.install('very_good');
784778

785779
// Different format needed for matching cli output
786780
expect(bashRc.readAsStringSync(), '''
@@ -790,14 +784,12 @@ void main() {
790784
## [/Completion]
791785
792786
''');
793-
794787
},
795788
);
796789

797790
test(
798791
'missing .bashrc and .bash_profile',
799-
() {
800-
792+
() {
801793
final bashInstallation = CompletionInstallation(
802794
logger: logger,
803795
isWindows: false,
@@ -808,18 +800,17 @@ void main() {
808800
);
809801

810802
expect(
811-
() => bashInstallation.install('very_good'),
803+
() => bashInstallation.install('very_good'),
812804
throwsA(
813805
isA<CompletionInstallationException>().having(
814-
(e) => e.message,
806+
(e) => e.message,
815807
'message',
816808
'No configuration files where found at '
817809
'\n ${path.join(tempDir.path, '.bashrc')}'
818810
'\n ${path.join(tempDir.path, '.bash_profile')}',
819811
),
820812
),
821813
);
822-
823814
},
824815
);
825816
});

0 commit comments

Comments
 (0)