[Concept,10/29] buildman: Initialise all attributes in Builder.__init__()

Message ID 20260106220403.2915630-11-sjg@u-boot.org
State New
Headers
Series buildman: Clean up builder.py |

Commit Message

Simon Glass Jan. 6, 2026, 10:03 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Add initialisation for all instance attributes in __init__() to fix
pylint W0201 (attribute-defined-outside-init) warnings. These attributes
were previously only set in other methods like set_display_options(),
reset_result_summary(), setup_build() and build_boards().

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 tools/buildman/builder.py | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
  

Patch

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 25e802a104c..b3f979e91dd 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -402,6 +402,39 @@  class Builder:
 
         self.thread_exceptions = []
         self.test_thread_exceptions = test_thread_exceptions
+
+        # Attributes used by set_display_options()
+        self._show_errors = False
+        self._show_sizes = False
+        self._show_detail = False
+        self._show_bloat = False
+        self._list_error_boards = False
+        self._show_config = False
+        self._show_environment = False
+        self._filter_dtb_warnings = False
+        self._filter_migration_warnings = False
+
+        # Attributes set by other methods
+        self._build_period = None
+        self.commit = None
+        self.upto = 0
+        self.warned = 0
+        self.fail = 0
+        self.commit_count = 0
+        self.commits = None
+        self.count = 0
+        self._timestamps = None
+        self._verbose = False
+
+        # Attributes for result summaries
+        self._base_board_dict = {}
+        self._base_err_lines = []
+        self._base_warn_lines = []
+        self._base_err_line_boards = {}
+        self._base_warn_line_boards = {}
+        self._base_config = None
+        self._base_environment = None
+
         if self.num_threads:
             self._single_builder = None
             self.queue = queue.Queue()