From 83b0de1369c3e36523f52c17da6330442ea13915 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 6 Oct 2024 09:17:34 +0200 Subject: [PATCH] Updated pylintrc to version 3.2 --- .pylintrc | 24 ++++++++++++++++++------ dfvfs/encryption/aes_decrypter.py | 1 + dfvfs/encryption/blowfish_decrypter.py | 1 + dfvfs/encryption/des3_decrypter.py | 1 + dfvfs/lib/cpio.py | 1 + run_tests.py | 2 -- setup.cfg | 2 +- tests/helpers/volume_scanner.py | 2 ++ tox.ini | 2 +- 9 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.pylintrc b/.pylintrc index 7cb4eb3f..47125456 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,4 +1,4 @@ -# Pylint 3.0.x configuration file +# Pylint 3.2.x configuration file # # This file is generated by l2tdevtools update-dependencies.py, any dependency # related changes should be made in dependencies.ini. @@ -29,6 +29,7 @@ clear-cache-post-run=no # A comma-separated list of package or module names from where C extensions may # be loaded. Extensions are loading into the active Python interpreter and may # run arbitrary code. +# extension-pkg-allow-list= extension-pkg-allow-list=pybde,pycaes,pyewf,pyfcrypto,pyfsapfs,pyfsext,pyfsfat,pyfshfs,pyfsntfs,pyfsxfs,pyfvde,pyfwnt,pyluksde,pymodi,pyphdi,pyqcow,pysigscan,pysmdev,pysmraw,pytsk3,pyvhdi,pyvmdk,pyvsapm,pyvsgpt,pyvshadow,pyvslvm,xattr # A comma-separated list of package or module names from where C extensions may @@ -63,10 +64,11 @@ ignore-paths= # Emacs file locks ignore-patterns=^\.# -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis). It -# supports qualified module names, as well as Unix pattern matching. +# List of module names for which member attributes should not be checked and +# will not be imported (useful for modules/projects where namespaces are +# manipulated during runtime and thus existing member attributes cannot be +# deduced by static analysis). It supports qualified module names, as well as +# Unix pattern matching. ignored-modules= # Python code to execute, usually for sys.path manipulation such as @@ -85,11 +87,16 @@ limit-inference-results=100 # List of plugins (as comma separated values of python module names) to load, # usually to register additional checkers. +# load-plugins= load-plugins=pylint.extensions.docparams # Pickle collected data for later comparisons. persistent=yes +# Resolve imports to .pyi stubs if available. May reduce no-member messages and +# increase not-an-iterable messages. +prefer-stubs=no + # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. py-version=3.12 @@ -440,7 +447,6 @@ confidence=HIGH, # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". - disable=assignment-from-none, bad-inline-option, consider-using-f-string, @@ -478,6 +484,7 @@ disable=assignment-from-none, # either give multiple identifier separated by comma (,) or put this option # multiple time (only on the command line, not in the configuration file where # it should appear only once). See also the "--disable" option for examples. +# enable= enable=c-extension-no-member @@ -510,6 +517,11 @@ max-nested-blocks=5 # printed. never-returning-functions=sys.exit,argparse.parse_error +# Let 'consider-using-join' be raised when the separator to join on would be +# non-empty (resulting in expected fixes of the type: ``"- " + " - +# ".join(items)``) +suggest-join-with-non-empty-separator=yes + [REPORTS] diff --git a/dfvfs/encryption/aes_decrypter.py b/dfvfs/encryption/aes_decrypter.py index e713529d..dabf956e 100644 --- a/dfvfs/encryption/aes_decrypter.py +++ b/dfvfs/encryption/aes_decrypter.py @@ -82,6 +82,7 @@ def Decrypt(self, encrypted_data, finalize=False): remaining_encrypted_data = encrypted_data[-block_offset:] encrypted_data = encrypted_data[:-block_offset] + decrypted_data = b'' if self._cipher_mode == definitions.ENCRYPTION_MODE_CBC: decrypted_data = pycaes.crypt_cbc( self._aes_context, pycaes.crypt_modes.DECRYPT, diff --git a/dfvfs/encryption/blowfish_decrypter.py b/dfvfs/encryption/blowfish_decrypter.py index 528e0972..759c55ce 100644 --- a/dfvfs/encryption/blowfish_decrypter.py +++ b/dfvfs/encryption/blowfish_decrypter.py @@ -84,6 +84,7 @@ def Decrypt(self, encrypted_data, finalize=False): remaining_encrypted_data = encrypted_data[-block_offset:] encrypted_data = encrypted_data[:-block_offset] + decrypted_data = b'' if self._cipher_mode == definitions.ENCRYPTION_MODE_CBC: decrypted_data = pyfcrypto.crypt_blowfish_cbc( self._blowfish_context, pyfcrypto.crypt_modes.DECRYPT, diff --git a/dfvfs/encryption/des3_decrypter.py b/dfvfs/encryption/des3_decrypter.py index 79aba574..988cc0e9 100644 --- a/dfvfs/encryption/des3_decrypter.py +++ b/dfvfs/encryption/des3_decrypter.py @@ -84,6 +84,7 @@ def Decrypt(self, encrypted_data, finalize=False): remaining_encrypted_data = encrypted_data[-block_offset:] encrypted_data = encrypted_data[:-block_offset] + decrypted_data = b'' if self._cipher_mode == definitions.ENCRYPTION_MODE_CBC: decrypted_data = pyfcrypto.crypt_des3_cbc( self._des3_context, pyfcrypto.crypt_modes.DECRYPT, diff --git a/dfvfs/lib/cpio.py b/dfvfs/lib/cpio.py index f3445a85..19c4ddf8 100644 --- a/dfvfs/lib/cpio.py +++ b/dfvfs/lib/cpio.py @@ -118,6 +118,7 @@ def _ReadFileEntry(self, file_object, file_offset): Raises: FileFormatError: if the file entry cannot be read. """ + data_type_map = None if self.file_format == 'bin-big-endian': data_type_map = self._CPIO_BINARY_BIG_ENDIAN_FILE_ENTRY elif self.file_format == 'bin-little-endian': diff --git a/run_tests.py b/run_tests.py index 34f39ac5..daa6d61a 100755 --- a/run_tests.py +++ b/run_tests.py @@ -2,8 +2,6 @@ # -*- coding: utf-8 -*- """Script to run the tests.""" -from __future__ import print_function - import sys import unittest diff --git a/setup.cfg b/setup.cfg index 283909d7..fddfed8b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dfvfs -version = 20240505 +version = 20241006 description = Digital Forensics Virtual File System (dfVFS). long_description = dfVFS, or Digital Forensics Virtual File System, provides read-only access to file-system objects from various storage media types and file formats. The goal of dfVFS is to provide a generic interface for accessing file-system objects, for which it uses several back-ends that provide the actual implementation of the various storage media types, volume systems and file systems. long_description_content_type = text/plain diff --git a/tests/helpers/volume_scanner.py b/tests/helpers/volume_scanner.py index 8922aca4..7db22834 100644 --- a/tests/helpers/volume_scanner.py +++ b/tests/helpers/volume_scanner.py @@ -98,6 +98,8 @@ def UnlockEncryptedVolume( Returns: bool: True if the volume was unlocked. """ + password = None + if locked_scan_node.type_indicator == ( definitions.TYPE_INDICATOR_APFS_CONTAINER): password = self._APFS_PASSWORD diff --git a/tox.ini b/tox.ini index 7fcbdb1b..386c582e 100644 --- a/tox.ini +++ b/tox.ini @@ -53,7 +53,7 @@ deps = -rrequirements.txt -rtest_requirements.txt docformatter - pylint >= 3.0.0, < 3.1.0 + pylint >= 3.2.0, < 3.3.0 setuptools yamllint >= 1.26.0 commands =