[{"id":3483,"web_url":"https://patchwork.libcamera.org/comment/3483/","msgid":"<20200117213024.GF1074550@oden.dyn.berto.se>","date":"2020-01-17T21:30:24","subject":"Re: [libcamera-devel] [PATCH v2 2/6] checkstyle: Exit with 1 status\n\tif issues are found","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Nicolas,\n\nThanks for your work.\n\nOn 2020-01-17 14:17:29 -0500, Nicolas Dufresne wrote:\n> From: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> \n> Makes the tool return 1 if there is any potential issues. This is\n> needed when using this tool for pre-commit hook in order to abort\n> the commit process.\n> \n> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  utils/checkstyle.py | 9 ++++++---\n>  1 file changed, 6 insertions(+), 3 deletions(-)\n>  mode change 100755 => 100644 utils/checkstyle.py\n> \n> diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> old mode 100755\n> new mode 100644\n> index 7edea25..e7375b3\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -541,7 +541,7 @@ def check_style(top_level, commit):\n>      files = [f for f in files if len([p for p in patterns if fnmatch.fnmatch(os.path.basename(f), p)])]\n>      if len(files) == 0:\n>          print(\"Commit doesn't touch source files, skipping\")\n> -        return\n> +        return 0\n>  \n>      issues = 0\n>      for f in files:\n> @@ -554,6 +554,8 @@ def check_style(top_level, commit):\n>          print(\"%u potential style %s detected, please review\" % \\\n>                  (issues, 'issue' if issues == 1 else 'issues'))\n>  \n> +    return issues\n> +\n>  \n>  def extract_revlist(revs):\n>      \"\"\"Extract a list of commits on which to operate from a revision or revision\n> @@ -632,11 +634,12 @@ def main(argv):\n>  \n>      revlist = extract_revlist(args.revision_range)\n>  \n> +    issues = 0\n>      for commit in revlist:\n> -        check_style(top_level, commit)\n> +        issues += check_style(top_level, commit)\n>          print('')\n>  \n> -    return 0\n> +    return min(issues, 1)\n>  \n>  \n>  if __name__ == '__main__':\n> -- \n> 2.24.1\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A56C860782\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 17 Jan 2020 22:30:26 +0100 (CET)","by mail-lf1-x141.google.com with SMTP id n12so19443781lfe.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 17 Jan 2020 13:30:26 -0800 (PST)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\tk25sm12725638lji.42.2020.01.17.13.30.25\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 17 Jan 2020 13:30:25 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=YAY7phr7kIOuTJcGWpZsIafEa5Ljo0NIvVCTDsWGNT8=;\n\tb=IA2rcyFYz78MYg6RrYkgg/ZZTB7r11l0RJ1MPnswEMLBYlTzH+lX9arKCeQgQ98OKq\n\tWSiqpzTaTcdThKQKjdFcnSyD/B2CDtzsf9BGDscNzvAJDnAoe1xZg0e9aHt2G0BydXNW\n\tYNGmuNGoUyhUTCylhmTw8nS5vEh/3kMS68X4ZUOcT+U4AwzjIb5P1kUWzICn6DaO9KuK\n\tZkCkqzq/5FVR+aVsn7KfU2UJHfGnrUeExU81RPb7roRW3vzJLekBsLn5uDwyg5wVJm4k\n\trPMs2UsaiHoFPkHwy9YpkLAJ1WyXVBLERigaaFOYxGWCcyoukHptAv8DIHopt6yofCNg\n\tLU/A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=YAY7phr7kIOuTJcGWpZsIafEa5Ljo0NIvVCTDsWGNT8=;\n\tb=tVBhZXTyWYWlnXD3BV9mXIE0PIbeBkLXHBTWA3HAGhDmVXym0QlUU9l297foozjga1\n\tOGtZ3mNZDenDbGVP02QiAvDOn0iTzCUe5gtf8qQDzmvoC+s9txtJeDI2XnRPhRKjmMEI\n\tA8s40BkJpwMMsfba7UlSCCSnIVEXDf1K4Sui7Fdfw1Z+r5E2AV3BFNPLOqKr38d/YHnX\n\t1EervSoHV3h4K6AHUi8JjJBiDpl+VguMYd91rgQd5X1yXr2GNUOX9CSQK4m/eLhDeOXC\n\tpR1mvbvQnIz74Z7aOS/7mQqIA+dp/7nOgBjl7AuoOlfRrzkFECQf7IfXafxRY5/xsS6Z\n\tFPVg==","X-Gm-Message-State":"APjAAAW/uzMaZ4O4Vrqv0GJqObkXmi74vSNUYw+qBU4Q/ezmQFl6uZXY\n\t9pV29JakPxfTca7FTx2y4EJ1pQ==","X-Google-Smtp-Source":"APXvYqzNfenEa6lh7PAbSR5nZWIdUiClb1MEug1zFCbnEBQ1l7CyY7mWJCLUCCkGHoA/UPEY5a4abQ==","X-Received":"by 2002:a19:7d04:: with SMTP id y4mr6303991lfc.111.1579296625981;\n\tFri, 17 Jan 2020 13:30:25 -0800 (PST)","Date":"Fri, 17 Jan 2020 22:30:24 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Cc":"libcamera-devel@lists.libcamera.org,\n\tNicolas Dufresne <nicolas.dufresne@collabora.com>","Message-ID":"<20200117213024.GF1074550@oden.dyn.berto.se>","References":"<20200117191733.198897-1-nicolas@ndufresne.ca>\n\t<20200117191733.198897-3-nicolas@ndufresne.ca>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200117191733.198897-3-nicolas@ndufresne.ca>","Subject":"Re: [libcamera-devel] [PATCH v2 2/6] checkstyle: Exit with 1 status\n\tif issues are found","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 17 Jan 2020 21:30:26 -0000"}},{"id":3485,"web_url":"https://patchwork.libcamera.org/comment/3485/","msgid":"<20200117215820.GN5711@pendragon.ideasonboard.com>","date":"2020-01-17T21:58:20","subject":"Re: [libcamera-devel] [PATCH v2 2/6] checkstyle: Exit with 1 status\n\tif issues are found","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Nicolas,\n\nThank you for the patch.\n\nOn Fri, Jan 17, 2020 at 02:17:29PM -0500, Nicolas Dufresne wrote:\n> From: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> \n> Makes the tool return 1 if there is any potential issues. This is\n> needed when using this tool for pre-commit hook in order to abort\n> the commit process.\n> \n> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> ---\n>  utils/checkstyle.py | 9 ++++++---\n>  1 file changed, 6 insertions(+), 3 deletions(-)\n>  mode change 100755 => 100644 utils/checkstyle.py\n> \n> diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> old mode 100755\n> new mode 100644\n> index 7edea25..e7375b3\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -541,7 +541,7 @@ def check_style(top_level, commit):\n>      files = [f for f in files if len([p for p in patterns if fnmatch.fnmatch(os.path.basename(f), p)])]\n>      if len(files) == 0:\n>          print(\"Commit doesn't touch source files, skipping\")\n> -        return\n> +        return 0\n>  \n>      issues = 0\n>      for f in files:\n> @@ -554,6 +554,8 @@ def check_style(top_level, commit):\n>          print(\"%u potential style %s detected, please review\" % \\\n>                  (issues, 'issue' if issues == 1 else 'issues'))\n>  \n> +    return issues\n> +\n>  \n>  def extract_revlist(revs):\n>      \"\"\"Extract a list of commits on which to operate from a revision or revision\n> @@ -632,11 +634,12 @@ def main(argv):\n>  \n>      revlist = extract_revlist(args.revision_range)\n>  \n> +    issues = 0\n>      for commit in revlist:\n> -        check_style(top_level, commit)\n> +        issues += check_style(top_level, commit)\n>          print('')\n>  \n> -    return 0\n> +    return min(issues, 1)\n\nI find this a bit difficult to read, but the python alternative to the C\nternary operator would be\n\n\treturn issues and 1 or 0\n\nwhich may not be more reable.\n\n\tif issues:\n\t\treturn 1\n\telse:\n\t\treturn 0\n\nmay be an option, but not very nice either. I'll leave it up to you,\nmaybe\n\n\t# Return an error if any issues have been detected\n\treturn min(issues, 0)\n\nIn any case,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \n>  \n>  if __name__ == '__main__':","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6453D60782\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 17 Jan 2020 22:58:35 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C5D449A1;\n\tFri, 17 Jan 2020 22:58:34 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1579298315;\n\tbh=9bcXWOsgDpoxU/9tHZT2T7GmNf5o4AMKfWZkTHJ9QYk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Vye5x0PxkXLN+CagGRff6ZMxe2oTgbx4zV+vx9zNlkW43Ze7+jLhUdkhqHGkz4Rtk\n\tbFhof7AB7xOM4psHoYRQI8I+V6SIfrJAr0GrzNGkmm4VPhQl2vWRunNsT/MDs98yQy\n\tjvKkbkQgYIstBXkx8NULDcpYfp2vtALrE7Elfdyc=","Date":"Fri, 17 Jan 2020 23:58:20 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Cc":"libcamera-devel@lists.libcamera.org,\n\tNicolas Dufresne <nicolas.dufresne@collabora.com>","Message-ID":"<20200117215820.GN5711@pendragon.ideasonboard.com>","References":"<20200117191733.198897-1-nicolas@ndufresne.ca>\n\t<20200117191733.198897-3-nicolas@ndufresne.ca>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200117191733.198897-3-nicolas@ndufresne.ca>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2 2/6] checkstyle: Exit with 1 status\n\tif issues are found","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 17 Jan 2020 21:58:35 -0000"}},{"id":3486,"web_url":"https://patchwork.libcamera.org/comment/3486/","msgid":"<8ecc33f225f9029bdebd887c8d6e658aaf93f60a.camel@collabora.com>","date":"2020-01-17T22:07:40","subject":"Re: [libcamera-devel] [PATCH v2 2/6] checkstyle: Exit with 1 status\n\tif issues are found","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Le vendredi 17 janvier 2020 à 23:58 +0200, Laurent Pinchart a écrit :\n> Hi Nicolas,\n> \n> Thank you for the patch.\n> \n> On Fri, Jan 17, 2020 at 02:17:29PM -0500, Nicolas Dufresne wrote:\n> > From: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > \n> > Makes the tool return 1 if there is any potential issues. This is\n> > needed when using this tool for pre-commit hook in order to abort\n> > the commit process.\n> > \n> > Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > ---\n> >  utils/checkstyle.py | 9 ++++++---\n> >  1 file changed, 6 insertions(+), 3 deletions(-)\n> >  mode change 100755 => 100644 utils/checkstyle.py\n> > \n> > diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> > old mode 100755\n> > new mode 100644\n> > index 7edea25..e7375b3\n> > --- a/utils/checkstyle.py\n> > +++ b/utils/checkstyle.py\n> > @@ -541,7 +541,7 @@ def check_style(top_level, commit):\n> >      files = [f for f in files if len([p for p in patterns if\n> > fnmatch.fnmatch(os.path.basename(f), p)])]\n> >      if len(files) == 0:\n> >          print(\"Commit doesn't touch source files, skipping\")\n> > -        return\n> > +        return 0\n> >  \n> >      issues = 0\n> >      for f in files:\n> > @@ -554,6 +554,8 @@ def check_style(top_level, commit):\n> >          print(\"%u potential style %s detected, please review\" % \\\n> >                  (issues, 'issue' if issues == 1 else 'issues'))\n> >  \n> > +    return issues\n> > +\n> >  \n> >  def extract_revlist(revs):\n> >      \"\"\"Extract a list of commits on which to operate from a revision or\n> > revision\n> > @@ -632,11 +634,12 @@ def main(argv):\n> >  \n> >      revlist = extract_revlist(args.revision_range)\n> >  \n> > +    issues = 0\n> >      for commit in revlist:\n> > -        check_style(top_level, commit)\n> > +        issues += check_style(top_level, commit)\n> >          print('')\n> >  \n> > -    return 0\n> > +    return min(issues, 1)\n> \n> I find this a bit difficult to read, but the python alternative to the C\n> ternary operator would be\n> \n> \treturn issues and 1 or 0\n> \n> which may not be more reable.\n> \n> \tif issues:\n> \t\treturn 1\n> \telse:\n> \t\treturn 0\n> \n> may be an option, but not very nice either. I'll leave it up to you,\n> maybe\n> \n> \t# Return an error if any issues have been detected\n> \treturn min(issues, 0)\n\nOne of the two last suggestion will do, I have no preference, but not the first\none, that's just worst. Will you fix it why pushing ?\n\n> \n> In any case,\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> >  \n> >  \n> >  if __name__ == '__main__':","headers":{"Return-Path":"<nicolas.dufresne@collabora.com>","Received":["from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B58460782\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 17 Jan 2020 23:07:50 +0100 (CET)","from nicolas-tpx395.localdomain (unknown [IPv6:2610:98:8005::127])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits))\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id 9BE52294708;\n\tFri, 17 Jan 2020 22:07:49 +0000 (GMT)"],"Message-ID":"<8ecc33f225f9029bdebd887c8d6e658aaf93f60a.camel@collabora.com>","From":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Date":"Fri, 17 Jan 2020 17:07:40 -0500","In-Reply-To":"<20200117215820.GN5711@pendragon.ideasonboard.com>","References":"<20200117191733.198897-1-nicolas@ndufresne.ca>\n\t<20200117191733.198897-3-nicolas@ndufresne.ca>\n\t<20200117215820.GN5711@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","User-Agent":"Evolution 3.34.3 (3.34.3-1.fc31) ","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v2 2/6] checkstyle: Exit with 1 status\n\tif issues are found","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 17 Jan 2020 22:07:50 -0000"}},{"id":3490,"web_url":"https://patchwork.libcamera.org/comment/3490/","msgid":"<20200117221455.GP5711@pendragon.ideasonboard.com>","date":"2020-01-17T22:14:55","subject":"Re: [libcamera-devel] [PATCH v2 2/6] checkstyle: Exit with 1 status\n\tif issues are found","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Nicolas,\n\nOn Fri, Jan 17, 2020 at 05:07:40PM -0500, Nicolas Dufresne wrote:\n> Le vendredi 17 janvier 2020 à 23:58 +0200, Laurent Pinchart a écrit :\n> > On Fri, Jan 17, 2020 at 02:17:29PM -0500, Nicolas Dufresne wrote:\n> > > From: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > > \n> > > Makes the tool return 1 if there is any potential issues. This is\n> > > needed when using this tool for pre-commit hook in order to abort\n> > > the commit process.\n> > > \n> > > Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > > ---\n> > >  utils/checkstyle.py | 9 ++++++---\n> > >  1 file changed, 6 insertions(+), 3 deletions(-)\n> > >  mode change 100755 => 100644 utils/checkstyle.py\n> > > \n> > > diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> > > old mode 100755\n> > > new mode 100644\n> > > index 7edea25..e7375b3\n> > > --- a/utils/checkstyle.py\n> > > +++ b/utils/checkstyle.py\n> > > @@ -541,7 +541,7 @@ def check_style(top_level, commit):\n> > >      files = [f for f in files if len([p for p in patterns if\n> > > fnmatch.fnmatch(os.path.basename(f), p)])]\n> > >      if len(files) == 0:\n> > >          print(\"Commit doesn't touch source files, skipping\")\n> > > -        return\n> > > +        return 0\n> > >  \n> > >      issues = 0\n> > >      for f in files:\n> > > @@ -554,6 +554,8 @@ def check_style(top_level, commit):\n> > >          print(\"%u potential style %s detected, please review\" % \\\n> > >                  (issues, 'issue' if issues == 1 else 'issues'))\n> > >  \n> > > +    return issues\n> > > +\n> > >  \n> > >  def extract_revlist(revs):\n> > >      \"\"\"Extract a list of commits on which to operate from a revision or\n> > > revision\n> > > @@ -632,11 +634,12 @@ def main(argv):\n> > >  \n> > >      revlist = extract_revlist(args.revision_range)\n> > >  \n> > > +    issues = 0\n> > >      for commit in revlist:\n> > > -        check_style(top_level, commit)\n> > > +        issues += check_style(top_level, commit)\n> > >          print('')\n> > >  \n> > > -    return 0\n> > > +    return min(issues, 1)\n> > \n> > I find this a bit difficult to read, but the python alternative to the C\n> > ternary operator would be\n> > \n> > \treturn issues and 1 or 0\n> > \n> > which may not be more reable.\n> > \n> > \tif issues:\n> > \t\treturn 1\n> > \telse:\n> > \t\treturn 0\n> > \n> > may be an option, but not very nice either. I'll leave it up to you,\n> > maybe\n> > \n> > \t# Return an error if any issues have been detected\n> > \treturn min(issues, 0)\n> \n> One of the two last suggestion will do, I have no preference, but not the first\n> one, that's just worst. Will you fix it why pushing ?\n\nIf you don't see a need to send a v3 due to other patches in this\nseries, I'll fix this (and possibly other small issues in other patches)\nwhen pushing, yes.\n\n> > \n> > In any case,\n> > \n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > \n> > >  \n> > >  \n> > >  if __name__ == '__main__':","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5DD7A60782\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 17 Jan 2020 23:15:10 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D79749A1;\n\tFri, 17 Jan 2020 23:15:09 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1579299310;\n\tbh=bPuXNnyyffXa4ZIK5oMJRVa9uH4IQmsNgUCdPstqmMA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=QMkHDfTdRCjwCwktehpeM5OA0L5YpeBk+kzFpStFWI2qX7f0+njU9zaHlQ413mcEa\n\tK5U5VFhErnRMAQnjSC76YAO6bv1A5/9IIaTepf6nlTNnOUfznqKPe8FfSnwX/OyNFO\n\t/8l5HhYFgjapdZZRk1W6vMK3IEP06eWye9FqZUGI=","Date":"Sat, 18 Jan 2020 00:14:55 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200117221455.GP5711@pendragon.ideasonboard.com>","References":"<20200117191733.198897-1-nicolas@ndufresne.ca>\n\t<20200117191733.198897-3-nicolas@ndufresne.ca>\n\t<20200117215820.GN5711@pendragon.ideasonboard.com>\n\t<8ecc33f225f9029bdebd887c8d6e658aaf93f60a.camel@collabora.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<8ecc33f225f9029bdebd887c8d6e658aaf93f60a.camel@collabora.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2 2/6] checkstyle: Exit with 1 status\n\tif issues are found","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 17 Jan 2020 22:15:10 -0000"}}]