Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
ensure clang-tidy YML output file exists
Browse files Browse the repository at this point in the history
fixes unit test about main-mock
  • Loading branch information
2bndy5 committed Dec 8, 2023
1 parent de577a6 commit 46cdd3d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/clang_tidy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ Future<List<TidyNotification>> runClangTidy(
List<String>? extraArgs,
bool debug,
) async {
File(clangTidyYamlCache).writeAsBytesSync([]);
var cacheFile = File(clangTidyYamlCache);
if (!cacheFile.existsSync()) {
cacheFile.createSync();
} else {
cacheFile.writeAsBytesSync([]);
}
if (checks == '-*') return <TidyNotification>[];
var exe = makeClangToolExeVersion('clang-tidy', version);
var args = [
Expand Down

0 comments on commit 46cdd3d

Please sign in to comment.