Skip to content

Commit dac181b

Browse files
feat(plugins): add preserve_autoload option for PHP plugin configuration
When PHP linter extensions like Larastan bootstrap the Laravel application, they need the project's PSR-4 namespace mappings in the sandbox autoloader. Previously, filter_composer unconditionally stripped autoload/autoload-dev sections, causing "Class not found" crashes. This adds a preserve_autoload boolean (default false) that, when enabled, preserves autoload sections and creates symlinks from the sandbox to the project root so Composer's generated autoloader resolves paths to the actual source files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c7f67bb commit dac181b

File tree

3 files changed

+426
-3
lines changed

3 files changed

+426
-3
lines changed

qlty-check/src/planner/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,13 @@ fn configure_plugin(
175175
}
176176

177177
plugin_def.package_file = Some(package_file.to_str().unwrap_or_default().to_string());
178+
plugin_def.workspace_root = Some(prefixed_root);
178179
}
179180

180181
// This is becoming a weird pattern, we should probably refactor this?
181182
plugin_def.fetch = enabled_plugin.fetch.clone();
182183
plugin_def.package_filters = enabled_plugin.package_filters.clone();
184+
plugin_def.preserve_autoload = enabled_plugin.preserve_autoload;
183185
plugin_def.prefix = enabled_plugin.prefix.clone();
184186

185187
plugin_def

0 commit comments

Comments
 (0)