Re: [PATCH 2/2] apibuild: remove 'v' from pattern matching

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

 



On Wed, May 04, 2022 at 01:11:24PM +0200, Victor Toso wrote:
> This makes madatory to *not* add 'v' to version number.

*mandatory

> @@ -2218,7 +2218,7 @@ class docBuilder:
>                                return_comment="") -> (str, str, str):
>          since = ""
>          if comment is not None:
> -            comment_match = re.search(r"\(?Since: v?(\d+\.\d+\.\d+\.?\d?)\)?",
> +            comment_match = re.search(r"\(?Since: (\d+\.\d+\.\d+\.?\d?)\)?",
>                                        comment)
>              if comment_match:
>                  # Remove Since tag from the comment
> @@ -2229,7 +2229,7 @@ class docBuilder:
>                  since = comment_match.group(1)
>
>          if since == "" and return_comment is not None:
> -            return_match = re.search(r"\(?Since: v?(\d+\.\d+\.\d+\.?\d?)\)?",
> +            return_match = re.search(r"\(?Since: (\d+\.\d+\.\d+\.?\d?)\)?",
>                                       return_comment)

Needless to say, it would be amazing if this didn't have to be
changed in two separate spots... Lots of opportunities for
refactoring for someone with a strong will and a stronger stomach :)

  Reviewed-by: Andrea Bolognani <abologna@xxxxxxxxxx>

and pushed along with the previous patch.

-- 
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