Skip to content

unified_analytics and graphs: cleanup lints, bump pkg deps #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
oops
  • Loading branch information
kevmoo committed Jun 1, 2023
commit 28e31f8ac7f575ae381482e9e52bb07610d60caa
4 changes: 2 additions & 2 deletions pkgs/unified_analytics/lib/src/analytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ abstract class Analytics {
const FileSystem fs = LocalFileSystem();

// Ensure that the home directory has permissions enabled to write
final Directory? homeDirectory = getHomeDirectory(fs);
final homeDirectory = getHomeDirectory(fs);
if (homeDirectory == null ||
!checkDirectoryForWritePermissions(homeDirectory)) {
return NoOpAnalytics();
Expand Down Expand Up @@ -96,7 +96,7 @@ abstract class Analytics {
const FileSystem fs = LocalFileSystem();

// Ensure that the home directory has permissions enabled to write
final Directory? homeDirectory = getHomeDirectory(fs);
final homeDirectory = getHomeDirectory(fs);
if (homeDirectory == null ||
!checkDirectoryForWritePermissions(homeDirectory)) {
return NoOpAnalytics();
Expand Down
2 changes: 1 addition & 1 deletion pkgs/unified_analytics/lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ String get dateStamp {
bool checkDirectoryForWritePermissions(Directory directory) {
if (!directory.existsSync()) return false;

final FileStat fileStat = directory.statSync();
final fileStat = directory.statSync();
return fileStat.modeString()[1] == 'w';
}

Expand Down
4 changes: 2 additions & 2 deletions pkgs/unified_analytics/test/no_op_analytics_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ void main() {
});

test('Home directory without write permissions', () {
final FakeDirectory home = FakeDirectory(writeEnabled: false);
final home = FakeDirectory(writeEnabled: false);

expect(checkDirectoryForWritePermissions(home), false);
});

test('Home directory with write permissions', () {
final FakeDirectory home = FakeDirectory(writeEnabled: true);
final home = FakeDirectory(writeEnabled: true);

expect(checkDirectoryForWritePermissions(home), true);
});
Expand Down