Re: [PATCH v4 19/19] scripts: apibuild: add parsing variable's comments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 22, 2022 at 09:23:44PM +0200, Victor Toso wrote:
> +    def cleanup_code_comment(self, comment: str, type_name="") -> str:
>          if not isinstance(comment, str) or comment == "":
>              return ""
>
>          lines = comment.splitlines(True)
> +
> +        # If type_name is provided, check and remove header of
> +        # the comment block.
> +        if type_name != "" and f"{type_name}:" in lines[0]:
> +            del lines[0]

I think this might need to be tightened, and we should also refactor
things so that there's one single place where this cleanup happens
instead of having it open-coded all over the place. It can be done as
a follow-up though.

-- 
Andrea Bolognani / Red Hat / Virtualization




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux