Skip to content

Commit 806a384

Browse files
marschatthaclaude
andcommitted
fix(check): skip exported config for formatters when workspace file exists
Load repository config files into the staging area before exported configs so that workspace files take precedence. The existing to.exists() guard in load_config_file_from naturally skips the exported config when the workspace file is already present, making formatter behavior consistent with linters. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cb4269b commit 806a384

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

qlty-check/src/executor.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,20 @@ impl Executor {
314314

315315
let mut loaded_config_files = vec![];
316316

317-
// load exported config paths before anything else
317+
// load repository config files first so that workspace files take
318+
// precedence over exported configs in the staging area
319+
for config_file in &repository_config_files {
320+
if let Err(err) = load_config_file_from_repository(
321+
config_file,
322+
&self.plan.workspace,
323+
&self.plan.staging_area.destination_directory,
324+
) {
325+
error!("Failed to load config file from repository: {:?}", err);
326+
}
327+
}
328+
329+
// load exported config paths — these are skipped if the file already
330+
// exists in the destination (e.g. from a workspace config file above)
318331
for config_file in &exported_config_paths {
319332
if self.plan.workspace.root != self.plan.staging_area.destination_directory {
320333
// for formatters
@@ -337,16 +350,6 @@ impl Executor {
337350
self.check_and_copy_configs_into_tool_install(&mut loaded_config_files)?;
338351
self.plan_plugins_fetch(&mut loaded_config_files)?;
339352

340-
for config_file in &repository_config_files {
341-
if let Err(err) = load_config_file_from_repository(
342-
config_file,
343-
&self.plan.workspace,
344-
&self.plan.staging_area.destination_directory,
345-
) {
346-
error!("Failed to load config file from repository: {:?}", err);
347-
}
348-
}
349-
350353
for config_file in &config_file_names {
351354
if self.plan.workspace.root != self.plan.staging_area.destination_directory {
352355
// for formatters

0 commit comments

Comments
 (0)