From 708356d41c4fdb82bf3e40f22446455c358d157e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 27 Feb 2024 03:30:50 +0100 Subject: [PATCH] gnulib-tool.py: Add more comments. * pygnulib/main.py: Add comments regarding code style. Mention the pycodestyle and pylint configurations. --- ChangeLog | 6 ++++++ pygnulib/main.py | 21 +++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17ad488893..d399841e18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-02-26 Bruno Haible + + gnulib-tool.py: Add more comments. + * pygnulib/main.py: Add comments regarding code style. Mention the + pycodestyle and pylint configurations. + 2024-02-26 Collin Funk gnulib-tool.py: Add configuration files for Python tools. diff --git a/pygnulib/main.py b/pygnulib/main.py index cfa59c6562..443300c439 100644 --- a/pygnulib/main.py +++ b/pygnulib/main.py @@ -24,11 +24,28 @@ # - Place line breaks to help reading the code: # Avoid line breaks inside expressions, if they can be avoided. # Do use line breaks to separate the parts of [ ... for ... ] iterations. +# - String literals: Use 'single-quotes'. +# Rationale: +# - Comparison operators: +# Use == and != for variables which can contain only strings, numbers, lists, +# and None. +# Use 'is' and 'is not' for variables which can contain only class instances +# (e.g. GLModule instances) and None. +# Rationale: + # You can use this command to check the style: -# $ pycodestyle --max-line-length=136 --ignore=E265,W503,E241,E711,E712,E201,E202,E221 pygnulib/*.py +# $ pycodestyle *.py +# The pycodestyle configuration is found in the file setup.cfg. +# Documentation: +# # You can use this command to check for mistakes: -# $ pylint --disable=C0103,C0114,C0121,C0209,C0301,C0302,R0902,R0912,R0913,R0914,R0915,R1705,R1702,R1720 pygnulib/*.py +# $ pylint *.py +# The pylint configuration is found in the file .pylintrc. +# Note: This configuration is only effective when you invoke pylint from this +# directory. +# Documentation: +# #=============================================================================== -- 2.39.5