[libcamera-devel,v3,1/6] checkstyle: Move from pep8 to pycodestyle

Message ID 20200118035448.230530-2-nicolas@ndufresne.ca
State Superseded
Headers show
Series
  • Add the ability to do pre-commit style check
Related show

Commit Message

Nicolas Dufresne Jan. 18, 2020, 3:54 a.m. UTC
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>

The tool has been renamed in 2016 to make it more obvious what it
is doing. There is no other changes needed on our side.

See https://github.com/PyCQA/pycodestyle/issues/466

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 utils/checkstyle.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart Jan. 18, 2020, 5:43 p.m. UTC | #1
Hi Nicolas,

Thank you for the patch.

On Fri, Jan 17, 2020 at 10:54:43PM -0500, Nicolas Dufresne wrote:
> From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> 
> The tool has been renamed in 2016 to make it more obvious what it
> is doing. There is no other changes needed on our side.
> 
> See https://github.com/PyCQA/pycodestyle/issues/466
> 
> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  utils/checkstyle.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/checkstyle.py b/utils/checkstyle.py
> index 93f0291..7edea25 100755
> --- a/utils/checkstyle.py
> +++ b/utils/checkstyle.py
> @@ -321,10 +321,10 @@ class Pep8Checker(StyleChecker):
>          data = ''.join(self.__content).encode('utf-8')
>  
>          try:
> -            ret = subprocess.run(['pep8', '--ignore=E501', '-'],
> +            ret = subprocess.run(['pycodestyle', '--ignore=E501', '-'],
>                                   input=data, stdout=subprocess.PIPE)
>          except FileNotFoundError:
> -            issues.append(StyleIssue(0, None, "Please install pep8 to validate python additions"))
> +            issues.append(StyleIssue(0, None, "Please install pycodestyle to validate python additions"))
>              return issues
>  
>          results = ret.stdout.decode('utf-8').splitlines()
Laurent Pinchart Jan. 18, 2020, 6:16 p.m. UTC | #2
On Sat, Jan 18, 2020 at 07:43:30PM +0200, Laurent Pinchart wrote:
> On Fri, Jan 17, 2020 at 10:54:43PM -0500, Nicolas Dufresne wrote:
> > From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> > 
> > The tool has been renamed in 2016 to make it more obvious what it
> > is doing. There is no other changes needed on our side.
> > 
> > See https://github.com/PyCQA/pycodestyle/issues/466
> > 
> > Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

I forgot to say

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

:-)

> > ---
> >  utils/checkstyle.py | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/utils/checkstyle.py b/utils/checkstyle.py
> > index 93f0291..7edea25 100755
> > --- a/utils/checkstyle.py
> > +++ b/utils/checkstyle.py
> > @@ -321,10 +321,10 @@ class Pep8Checker(StyleChecker):
> >          data = ''.join(self.__content).encode('utf-8')
> >  
> >          try:
> > -            ret = subprocess.run(['pep8', '--ignore=E501', '-'],
> > +            ret = subprocess.run(['pycodestyle', '--ignore=E501', '-'],
> >                                   input=data, stdout=subprocess.PIPE)
> >          except FileNotFoundError:
> > -            issues.append(StyleIssue(0, None, "Please install pep8 to validate python additions"))
> > +            issues.append(StyleIssue(0, None, "Please install pycodestyle to validate python additions"))
> >              return issues
> >  
> >          results = ret.stdout.decode('utf-8').splitlines()

Patch

diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index 93f0291..7edea25 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -321,10 +321,10 @@  class Pep8Checker(StyleChecker):
         data = ''.join(self.__content).encode('utf-8')
 
         try:
-            ret = subprocess.run(['pep8', '--ignore=E501', '-'],
+            ret = subprocess.run(['pycodestyle', '--ignore=E501', '-'],
                                  input=data, stdout=subprocess.PIPE)
         except FileNotFoundError:
-            issues.append(StyleIssue(0, None, "Please install pep8 to validate python additions"))
+            issues.append(StyleIssue(0, None, "Please install pycodestyle to validate python additions"))
             return issues
 
         results = ret.stdout.decode('utf-8').splitlines()