Re: [PATCH v3 02/30] syntax-check: prohibit_virXXXFree: skip strings

2022-04-21 Thread Victor Toso
Hi,

On Thu, Apr 21, 2022 at 02:02:25PM +0200, Peter Krempa wrote:
> On Wed, Apr 20, 2022 at 21:07:51 +0200, Victor Toso wrote:
> > We should allow strings (not the functions) in the format of
> > "virDomainFree" and friends.
> > 
> > This fixes an error in latter commit "scripts: apibuild: parse
> > 'Since' for functions" as it uses this function names as keys
> > in a dictionary.
> > 
> > Fixes:
> >  |  ...
> >  |  prohibit_virXXXFree
> >  |  libvirt/scripts/apibuild.py:163:'virDomainFree': '0.0.1',
> >  |  make: Leaving directory '/home/toso/src/libvirt/build/build-aux'
> >  |  stderr:
> >  |  build-aux/syntax-check.mk: avoid using virXXXFree, use virObjectUnref 
> > instead
> >  |  make: *** [libvirt/build-aux/syntax-check.mk:829: 
> > sc_prohibit_virXXXFree] Error 1
> > 
> > Signed-off-by: Victor Toso 
> > ---
> 
> This patch should not be needed once we will not need to have an
> override for 'virDomainFree'.

Yes, I'll be able to drop this one.

> 
> >  build-aux/syntax-check.mk | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
> > index eb403f3d3f..07e0295995 100644
> > --- a/build-aux/syntax-check.mk
> > +++ b/build-aux/syntax-check.mk
> > @@ -827,7 +827,7 @@ sc_prohibit_system_error_with_vir_err:
> >  # docs, examples, tools, src/libvirt-*.c, and include/libvirt/libvirt-*.h
> >  sc_prohibit_virXXXFree:
> > 
> > @prohibit='\bvir(Domain|Network|NodeDevice|StorageVol|StoragePool|Stream|Secret|NWFilter|Interface|DomainSnapshot)Free\b'
> >  \
> > -   exclude='sc_prohibit_virXXXFree' \
> > +   exclude="sc_prohibit_virXXXFree|'vir.*?Free'" \
> 
> IMO a better solution would be to exclude python files from the check.

I guess that would be in another parameter?

Cheers,
Victor


signature.asc
Description: PGP signature


Re: [PATCH v3 02/30] syntax-check: prohibit_virXXXFree: skip strings

2022-04-21 Thread Peter Krempa
On Wed, Apr 20, 2022 at 21:07:51 +0200, Victor Toso wrote:
> We should allow strings (not the functions) in the format of
> "virDomainFree" and friends.
> 
> This fixes an error in latter commit "scripts: apibuild: parse
> 'Since' for functions" as it uses this function names as keys
> in a dictionary.
> 
> Fixes:
>  |  ...
>  |  prohibit_virXXXFree
>  |  libvirt/scripts/apibuild.py:163:'virDomainFree': '0.0.1',
>  |  make: Leaving directory '/home/toso/src/libvirt/build/build-aux'
>  |  stderr:
>  |  build-aux/syntax-check.mk: avoid using virXXXFree, use virObjectUnref 
> instead
>  |  make: *** [libvirt/build-aux/syntax-check.mk:829: sc_prohibit_virXXXFree] 
> Error 1
> 
> Signed-off-by: Victor Toso 
> ---

This patch should not be needed once we will not need to have an
override for 'virDomainFree'.

>  build-aux/syntax-check.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
> index eb403f3d3f..07e0295995 100644
> --- a/build-aux/syntax-check.mk
> +++ b/build-aux/syntax-check.mk
> @@ -827,7 +827,7 @@ sc_prohibit_system_error_with_vir_err:
>  # docs, examples, tools, src/libvirt-*.c, and include/libvirt/libvirt-*.h
>  sc_prohibit_virXXXFree:
>   
> @prohibit='\bvir(Domain|Network|NodeDevice|StorageVol|StoragePool|Stream|Secret|NWFilter|Interface|DomainSnapshot)Free\b'
>  \
> - exclude='sc_prohibit_virXXXFree' \
> + exclude="sc_prohibit_virXXXFree|'vir.*?Free'" \

IMO a better solution would be to exclude python files from the check.



[PATCH v3 02/30] syntax-check: prohibit_virXXXFree: skip strings

2022-04-20 Thread Victor Toso
We should allow strings (not the functions) in the format of
"virDomainFree" and friends.

This fixes an error in latter commit "scripts: apibuild: parse
'Since' for functions" as it uses this function names as keys
in a dictionary.

Fixes:
 |  ...
 |  prohibit_virXXXFree
 |  libvirt/scripts/apibuild.py:163:'virDomainFree': '0.0.1',
 |  make: Leaving directory '/home/toso/src/libvirt/build/build-aux'
 |  stderr:
 |  build-aux/syntax-check.mk: avoid using virXXXFree, use virObjectUnref 
instead
 |  make: *** [libvirt/build-aux/syntax-check.mk:829: sc_prohibit_virXXXFree] 
Error 1

Signed-off-by: Victor Toso 
---
 build-aux/syntax-check.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
index eb403f3d3f..07e0295995 100644
--- a/build-aux/syntax-check.mk
+++ b/build-aux/syntax-check.mk
@@ -827,7 +827,7 @@ sc_prohibit_system_error_with_vir_err:
 # docs, examples, tools, src/libvirt-*.c, and include/libvirt/libvirt-*.h
 sc_prohibit_virXXXFree:

@prohibit='\bvir(Domain|Network|NodeDevice|StorageVol|StoragePool|Stream|Secret|NWFilter|Interface|DomainSnapshot)Free\b'
 \
-   exclude='sc_prohibit_virXXXFree' \
+   exclude="sc_prohibit_virXXXFree|'vir.*?Free'" \
halt='avoid using virXXXFree, use virObjectUnref instead' \
  $(_sc_search_regexp)
 
-- 
2.35.1