All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] run-flake8: Filter out ./.git/ directory
@ 2020-05-11 12:03 Petr Lautrbach
  2020-05-12 19:32 ` Nicolas Iooss
  2020-05-13 15:10 ` Petr Lautrbach
  0 siblings, 2 replies; 4+ messages in thread
From: Petr Lautrbach @ 2020-05-11 12:03 UTC (permalink / raw)
  To: selinux; +Cc: Petr Lautrbach

When a branch has '.py' suffix git creates a file with the same suffix and this
file is found by the `find . -name '*.py'` command. Such files from './git' need
to be filtered out.

Fixes:

    $ PATH="$VIRTUAL_ENV/bin:$PATH" ./scripts/run-flake8
    Analyzing 189 Python scripts
    ./.git/logs/refs/heads/semanage-test.py:1:42: E999 SyntaxError: invalid syntax
    ./.git/refs/heads/semanage-test.py:1:4: E999 SyntaxError: invalid syntax
    The command "PATH="$VIRTUAL_ENV/bin:$PATH" ./scripts/run-flake8" exited with 1.

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 scripts/run-flake8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/run-flake8 b/scripts/run-flake8
index 24b1202fde99..67cccfe99e5f 100755
--- a/scripts/run-flake8
+++ b/scripts/run-flake8
@@ -7,7 +7,7 @@ if [ $# -eq 0 ] ; then
 
     # Run on both files ending with .py and Python files without extension
     # shellcheck disable=SC2046
-    set -- $( (find . -name '*.py' ; grep --exclude-dir=.git -l -e '^#!\s*/usr/bin/python' -e '^#!/usr/bin/env python' -r .) | sort -u )
+    set -- $( (find . -name '*.py' ; grep -l -e '^#!\s*/usr/bin/python' -e '^#!/usr/bin/env python' -r .) | grep -v '^\./\.git/' | sort -u )
     echo "Analyzing $# Python scripts"
 fi
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] run-flake8: Filter out ./.git/ directory
  2020-05-11 12:03 [PATCH] run-flake8: Filter out ./.git/ directory Petr Lautrbach
@ 2020-05-12 19:32 ` Nicolas Iooss
  2020-05-13 15:10 ` Petr Lautrbach
  1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Iooss @ 2020-05-12 19:32 UTC (permalink / raw)
  To: Petr Lautrbach; +Cc: SElinux list

On Mon, May 11, 2020 at 2:03 PM Petr Lautrbach <plautrba@redhat.com> wrote:
>
> When a branch has '.py' suffix git creates a file with the same suffix and this
> file is found by the `find . -name '*.py'` command. Such files from './git' need
> to be filtered out.
>
> Fixes:
>
>     $ PATH="$VIRTUAL_ENV/bin:$PATH" ./scripts/run-flake8
>     Analyzing 189 Python scripts
>     ./.git/logs/refs/heads/semanage-test.py:1:42: E999 SyntaxError: invalid syntax
>     ./.git/refs/heads/semanage-test.py:1:4: E999 SyntaxError: invalid syntax
>     The command "PATH="$VIRTUAL_ENV/bin:$PATH" ./scripts/run-flake8" exited with 1.
>
> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>

Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Thanks!
Nicolas

> ---
>  scripts/run-flake8 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/run-flake8 b/scripts/run-flake8
> index 24b1202fde99..67cccfe99e5f 100755
> --- a/scripts/run-flake8
> +++ b/scripts/run-flake8
> @@ -7,7 +7,7 @@ if [ $# -eq 0 ] ; then
>
>      # Run on both files ending with .py and Python files without extension
>      # shellcheck disable=SC2046
> -    set -- $( (find . -name '*.py' ; grep --exclude-dir=.git -l -e '^#!\s*/usr/bin/python' -e '^#!/usr/bin/env python' -r .) | sort -u )
> +    set -- $( (find . -name '*.py' ; grep -l -e '^#!\s*/usr/bin/python' -e '^#!/usr/bin/env python' -r .) | grep -v '^\./\.git/' | sort -u )
>      echo "Analyzing $# Python scripts"
>  fi
>
> --
> 2.26.2
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] run-flake8: Filter out ./.git/ directory
  2020-05-11 12:03 [PATCH] run-flake8: Filter out ./.git/ directory Petr Lautrbach
  2020-05-12 19:32 ` Nicolas Iooss
@ 2020-05-13 15:10 ` Petr Lautrbach
  2020-05-13 15:53   ` William Roberts
  1 sibling, 1 reply; 4+ messages in thread
From: Petr Lautrbach @ 2020-05-13 15:10 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 1613 bytes --]

On Mon, May 11, 2020 at 02:03:32PM +0200, Petr Lautrbach wrote:
> When a branch has '.py' suffix git creates a file with the same suffix and this
> file is found by the `find . -name '*.py'` command. Such files from './git' need
> to be filtered out.
> 
> Fixes:
> 
>     $ PATH="$VIRTUAL_ENV/bin:$PATH" ./scripts/run-flake8
>     Analyzing 189 Python scripts
>     ./.git/logs/refs/heads/semanage-test.py:1:42: E999 SyntaxError: invalid syntax
>     ./.git/refs/heads/semanage-test.py:1:4: E999 SyntaxError: invalid syntax
>     The command "PATH="$VIRTUAL_ENV/bin:$PATH" ./scripts/run-flake8" exited with 1.
> 
> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
> Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Applied.

> ---
>  scripts/run-flake8 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/run-flake8 b/scripts/run-flake8
> index 24b1202fde99..67cccfe99e5f 100755
> --- a/scripts/run-flake8
> +++ b/scripts/run-flake8
> @@ -7,7 +7,7 @@ if [ $# -eq 0 ] ; then
>  
>      # Run on both files ending with .py and Python files without extension
>      # shellcheck disable=SC2046
> -    set -- $( (find . -name '*.py' ; grep --exclude-dir=.git -l -e '^#!\s*/usr/bin/python' -e '^#!/usr/bin/env python' -r .) | sort -u )
> +    set -- $( (find . -name '*.py' ; grep -l -e '^#!\s*/usr/bin/python' -e '^#!/usr/bin/env python' -r .) | grep -v '^\./\.git/' | sort -u )
>      echo "Analyzing $# Python scripts"
>  fi
>  

-- 
()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] run-flake8: Filter out ./.git/ directory
  2020-05-13 15:10 ` Petr Lautrbach
@ 2020-05-13 15:53   ` William Roberts
  0 siblings, 0 replies; 4+ messages in thread
From: William Roberts @ 2020-05-13 15:53 UTC (permalink / raw)
  To: Petr Lautrbach; +Cc: SElinux list

On Wed, May 13, 2020 at 10:11 AM Petr Lautrbach <plautrba@redhat.com> wrote:
>
> On Mon, May 11, 2020 at 02:03:32PM +0200, Petr Lautrbach wrote:
> > When a branch has '.py' suffix git creates a file with the same suffix and this
> > file is found by the `find . -name '*.py'` command. Such files from './git' need
> > to be filtered out.
> >
> > Fixes:
> >
> >     $ PATH="$VIRTUAL_ENV/bin:$PATH" ./scripts/run-flake8
> >     Analyzing 189 Python scripts
> >     ./.git/logs/refs/heads/semanage-test.py:1:42: E999 SyntaxError: invalid syntax
> >     ./.git/refs/heads/semanage-test.py:1:4: E999 SyntaxError: invalid syntax
> >     The command "PATH="$VIRTUAL_ENV/bin:$PATH" ./scripts/run-flake8" exited with 1.
> >
> > Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
> > Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>
>
> Applied.

I updated the state to accepted in Patchwork

>
> > ---
> >  scripts/run-flake8 | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/run-flake8 b/scripts/run-flake8
> > index 24b1202fde99..67cccfe99e5f 100755
> > --- a/scripts/run-flake8
> > +++ b/scripts/run-flake8
> > @@ -7,7 +7,7 @@ if [ $# -eq 0 ] ; then
> >
> >      # Run on both files ending with .py and Python files without extension
> >      # shellcheck disable=SC2046
> > -    set -- $( (find . -name '*.py' ; grep --exclude-dir=.git -l -e '^#!\s*/usr/bin/python' -e '^#!/usr/bin/env python' -r .) | sort -u )
> > +    set -- $( (find . -name '*.py' ; grep -l -e '^#!\s*/usr/bin/python' -e '^#!/usr/bin/env python' -r .) | grep -v '^\./\.git/' | sort -u )
> >      echo "Analyzing $# Python scripts"
> >  fi
> >
>
> --
> ()  ascii ribbon campaign - against html e-mail
> /\  www.asciiribbon.org   - against proprietary attachments

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-13 15:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-11 12:03 [PATCH] run-flake8: Filter out ./.git/ directory Petr Lautrbach
2020-05-12 19:32 ` Nicolas Iooss
2020-05-13 15:10 ` Petr Lautrbach
2020-05-13 15:53   ` William Roberts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.