Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion snakedeploy/templates/plugins/executor-plugins/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __post_init__(self):
# access workflow
self.workflow
# access executor specific settings
self.workflow.executor_settings
self.executor_settings

Comment on lines 85 to 89
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix Ruff B018: remove useless expressions in post_init.

Bare expressions self.workflow and self.executor_settings do nothing and trigger B018. Either remove them or bind to _ to demonstrate access without linter noise.

Apply one of the following diffs (Option A preferred).

Option A — minimal, linter-friendly:

@@
     def __post_init__(self):
-        # access workflow
-        self.workflow
-        # access executor specific settings
-        self.executor_settings
+        # Access to interfaces (kept for illustration without tripping linters)
+        _ = self.workflow
+        _ = self.executor_settings

Option B — just delete, the preceding comments already explain access:

@@
     def __post_init__(self):
-        # access workflow
-        self.workflow
-        # access executor specific settings
-        self.executor_settings
+        # access workflow / executor settings as needed
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# access workflow
self.workflow
# access executor specific settings
self.workflow.executor_settings
self.executor_settings
def __post_init__(self):
- # access workflow
- self.workflow
- # access executor specific settings
# Access to interfaces (kept for illustration without tripping linters)
_ = self.workflow
_ = self.executor_settings
🧰 Tools
🪛 Ruff (0.12.2)

86-86: Found useless expression. Either assign it to a variable or remove it.

(B018)


88-88: Found useless expression. Either assign it to a variable or remove it.

(B018)

🤖 Prompt for AI Agents
In snakedeploy/templates/plugins/executor-plugins/init.py around lines 85 to 89,
there are bare expressions `self.workflow` and `self.executor_settings` in
__post_init__ that trigger Ruff B018; replace them with a linter-friendly no-op
access by assigning to underscore (e.g., `_ = self.workflow` and `_ =
self.executor_settings`) or simply remove the lines if the preceding comments
already convey the intent — Option A (assign to `_`) is preferred to show
intentional access while avoiding linter noise.

# IMPORTANT: in your plugin, only access methods and properties of
# Snakemake objects (like Workflow, Persistence, etc.) that are
Expand Down