Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2becd72

Browse files
committed
Delete temp directory.
1 parent 70e2a25 commit 2becd72

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tools/clang_tidy/lib/clang_tidy.dart

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// found in the LICENSE file.
44

55
import 'dart:convert' show LineSplitter, jsonDecode;
6-
import 'dart:io' as io show File, stderr, stdout;
6+
import 'dart:io' as io show Directory, File, stderr, stdout;
77

88
import 'package:meta/meta.dart';
99
import 'package:path/path.dart' as path;
@@ -161,10 +161,20 @@ class ClangTidy {
161161
);
162162
}
163163

164+
io.File? configPath = options.configPath;
165+
io.Directory? rewriteDir;
166+
if (configPath != null && options.excludeSlowChecks) {
167+
configPath = _createClangTidyConfigExcludingSlowLints(configPath);
168+
rewriteDir = io.Directory(path.dirname(configPath.path));
169+
}
164170
final _ComputeJobsResult computeJobsResult = await _computeJobs(
165171
changedFileBuildCommands,
166172
options,
173+
configPath,
167174
);
175+
if (rewriteDir != null) {
176+
rewriteDir.deleteSync(recursive: true);
177+
}
168178
final int computeResult = computeJobsResult.sawMalformed ? 1 : 0;
169179
final List<WorkerJob> jobs = computeJobsResult.jobs;
170180

@@ -298,11 +308,8 @@ class ClangTidy {
298308
Future<_ComputeJobsResult> _computeJobs(
299309
List<Command> commands,
300310
Options options,
311+
io.File? configPath,
301312
) async {
302-
io.File? configPath = options.configPath;
303-
if (configPath != null && options.excludeSlowChecks) {
304-
configPath = _createClangTidyConfigExcludingSlowLints(configPath);
305-
}
306313
bool sawMalformed = false;
307314
final List<WorkerJob> jobs = <WorkerJob>[];
308315
for (final Command command in commands) {

0 commit comments

Comments
 (0)