Thread (1 message) 1 message, 1 author, 2025-07-16

Re: [PATCH v3 09/17] tools/dot2c: Fix generated files going over 100 column limit

From: Nam Cao <hidden>
Date: 2025-07-16 09:34:45
Also in: lkml

On Wed, Jul 16, 2025 at 11:27:54AM +0200, Gabriele Monaco wrote:
On Tue, 2025-07-15 at 17:01 +0200, Nam Cao wrote:
quoted
On Tue, Jul 15, 2025 at 09:14:26AM +0200, Gabriele Monaco wrote:
quoted
From: Nam Cao <redacted>
-        strformat = self.__get_state_string_length()
-
+        maxlen = self.__get_max_strlen_of_states() +
len(self.enum_suffix)
+        # account for tabs and spaces/punctuation for each event
+        linetoolong = 16 + (maxlen + 3) * nr_events >=
self.line_length
I managed to figure out 16 is the indentation. But I failed to
understand
where is this '3' from.

Can you please add some comments for these magic numbers? Or better,
assign
them to variables with self-explanatory names.
Turns out it was wrong ;)
I'll fix it and make it clear.
Hah! Got you.

I'm guessing that it was supposed to be 2. I wait for the reveal in v4.

Nam
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help