[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250721145254.WPp6FNzS@linutronix.de>
Date: Mon, 21 Jul 2025 16:52:54 +0200
From: Nam Cao <namcao@...utronix.de>
To: Gabriele Monaco <gmonaco@...hat.com>
Cc: linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
linux-trace-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Tomas Glozar <tglozar@...hat.com>, Juri Lelli <jlelli@...hat.com>,
Clark Williams <williams@...hat.com>,
John Kacur <jkacur@...hat.com>
Subject: Re: [PATCH v4 09/14] tools/dot2c: Fix generated files going over 100
column limit
On Mon, Jul 21, 2025 at 10:23:19AM +0200, Gabriele Monaco wrote:
> The dot2c.py script generates all states in a single line. This breaks the
> 100 column limit when the state machines are non-trivial.
>
> Change dot2c.py to generate the states in separate lines in case the
> generated line is going to be too long.
>
> Also adapt existing monitors with line length over the limit.
>
> Suggested-by: Nam Cao <namcao@...utronix.de>
> Signed-off-by: Gabriele Monaco <gmonaco@...hat.com>
> ---
> - strformat = self.__get_state_string_length()
> -
> + maxlen = self.__get_max_strlen_of_states() + len(self.enum_suffix)
> + tab_braces = 2 * 8 + 2 + 1 # "\t\t{ " ... "}"
> + comma_space = 2 # ", " count last comma here
PEP8 prefers two spaces before the comments.
> + linetoolong = tab_braces + (maxlen + comma_space) * nr_events >= self.line_length
Shouldn't this be '>' instead of '>='? 100 columns are still within the
limit.
Nam
Powered by blists - more mailing lists