]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
gnulib-tool.py: Ignore 'use-dict-literal' warnings.
authorCollin Funk <collin.funk1@gmail.com>
Thu, 4 Apr 2024 22:29:50 +0000 (15:29 -0700)
committerBruno Haible <bruno@clisp.org>
Fri, 5 Apr 2024 00:57:44 +0000 (02:57 +0200)
* pygnulib/.pylintrc: Don't emit warning messages suggesting that
'dict()' be converted to '{}'. This literal can be mistaken for sets,
see discussion here:
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00054.html>
* pygnulib/main.py: Document this convention in coding style section.
* pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Convert an
occurrence of '{}' to 'dict()'.

ChangeLog
pygnulib/.pylintrc
pygnulib/GLFileSystem.py
pygnulib/main.py

index 3cceb4c60a7856ac3656368f83396414c00f7534..5a84f5a2c7e98ac5f3f0bdb1e1d7b2df7f352284 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-04-04  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Ignore 'use-dict-literal' warnings.
+       * pygnulib/.pylintrc: Don't emit warning messages suggesting that
+       'dict()' be converted to '{}'. This literal can be mistaken for sets,
+       see discussion here:
+       <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00054.html>
+       * pygnulib/main.py: Document this convention in coding style section.
+       * pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Convert an
+       occurrence of '{}' to 'dict()'.
+
 2024-04-04  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Fix pylint 'raise-missing-from' warnings.
index 15e2e8e80060a7bd0497642e208210b475b413b0..102accb37dbfdea415071b83adec7da1a8fdd46f 100644 (file)
@@ -1,7 +1,7 @@
 # .pylintrc
 
 [MESSAGES CONTROL]
-disable=C0103,C0114,C0121,C0123,C0209,C0301,C0302,R0902,R0912,R0913,R0914,R0915,R1705,R1702,R1720
+disable=C0103,C0114,C0121,C0123,C0209,C0301,C0302,R0902,R0912,R0913,R0914,R0915,R1705,R1702,R1720,R1735
 
 # Local Variables:
 # mode: conf
index e157578e54131214e9e3595e255794a4cc000c28..551ae177e4150e15e2a61ce3ca8774ac6f2a35de 100644 (file)
@@ -154,7 +154,7 @@ class GLFileSystem:
 class GLFileAssistant:
     '''GLFileAssistant is used to help with file processing.'''
 
-    def __init__(self, config: GLConfig, transformers: dict[str, tuple[re.Pattern, str] | None] = {}) -> None:
+    def __init__(self, config: GLConfig, transformers: dict[str, tuple[re.Pattern, str] | None] = dict()) -> None:
         '''Create GLFileAssistant instance.
 
         config stores information shared between classes.
index 233c79182ed96d566de29ec189a85bb6a6b61eee..4bf4da42799325b1031b4622d1aefc0063831502 100644 (file)
@@ -52,6 +52,8 @@
 # - Prefer the standard collection type hints over those provided in the
 #   typing module. The latter are deprecated and may be removed.
 #   Cf. <https://peps.python.org/pep-0585/>.
+# - Never use the {} literal, because it denotes a dictionary,
+#   as opposed to {x}, {x,y}, etc., which denote sets.
 
 # You can use this command to check the style:
 #   $ pycodestyle *.py