Refactor static analyses and config patchers into pyplugins#765
Refactor static analyses and config patchers into pyplugins#765
Conversation
- Created StaticPlugin base class and StaticPluginManager to dynamically load plugins. - Migrated all analyses and patchers to pyplugins/static_analysis/ and pyplugins/config_patchers/. - Implemented topological sorting with alphabetic tie-breaking for deterministic execution order. - Track plugin state with a SHA256 hash to automatically regenerate configuration when a plugin is modified or added.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Lintly has detected code quality issues in this pull request.
|
|
||
| logger = getColoredLogger("penguin.static_plugin_manager") | ||
|
|
||
| class StaticPluginManager: |
There was a problem hiding this comment.
E302: expected 2 blank lines, found 1
| """ | ||
| pass | ||
|
|
||
| class ConfigPatcherPlugin(StaticPlugin): |
There was a problem hiding this comment.
E302: expected 2 blank lines, found 1
| @@ -0,0 +1,37 @@ | |||
| from abc import ABC | |||
|
|
|||
| class StaticPlugin(ABC): | |||
There was a problem hiding this comment.
E302: expected 2 blank lines, found 1
| if saved_hash != current_hash: | ||
| logger.warning("Static plugins have changed. Auto-regenerating the config...") | ||
| from .gen_config import initialize_and_build_config | ||
| fs_tar = conf["core"].get("fs", "") |
| import re | ||
| from penguin.static_plugin import StaticAnalysisPlugin | ||
|
|
||
| class PseudofileFinder(StaticAnalysisPlugin): |
There was a problem hiding this comment.
E302: expected 2 blank lines, found 1
| from collections import defaultdict | ||
| from penguin.static_plugin import ConfigPatcherPlugin | ||
|
|
||
| class GenerateMissingFiles(ConfigPatcherPlugin): |
There was a problem hiding this comment.
E302: expected 2 blank lines, found 1
|
|
||
| logger = getColoredLogger("penguin.config_patchers") | ||
|
|
||
| class GenerateMissingDirs(ConfigPatcherPlugin): |
There was a problem hiding this comment.
E302: expected 2 blank lines, found 1
| import os | ||
| from penguin.static_plugin import ConfigPatcherPlugin | ||
|
|
||
| class ForceWWW(ConfigPatcherPlugin): |
There was a problem hiding this comment.
E302: expected 2 blank lines, found 1
| import re | ||
| from pathlib import Path | ||
|
|
||
| class FileHelper: |
There was a problem hiding this comment.
E302: expected 2 blank lines, found 1
| @@ -0,0 +1,28 @@ | |||
| from penguin.static_plugin import ConfigPatcherPlugin | |||
|
|
|||
| class DynamicExploration(ConfigPatcherPlugin): | |||
There was a problem hiding this comment.
E302: expected 2 blank lines, found 1
Refactor static analyses and config patchers to use plugin architecture
PR created automatically by Jules for task 9621120310990343842 started by @lacraig2