Skip to content

Commit

Permalink
Updated pylintrc to version 3.2 (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz authored Oct 6, 2024
1 parent 20b0d1b commit 7484aec
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 25 deletions.
24 changes: 18 additions & 6 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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,pycreg,pyewf,pyfcrypto,pyfsapfs,pyfsext,pyfsfat,pyfshfs,pyfsntfs,pyfsxfs,pyfvde,pyfwnt,pyluksde,pymodi,pyphdi,pyqcow,pyregf,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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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]

Expand Down
15 changes: 6 additions & 9 deletions dfimagetools/artifact_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,19 @@ def _BuildFindSpecsFromArtifactDefinition(

if source_type == artifacts_definitions.TYPE_INDICATOR_ARTIFACT_GROUP:
for source_name in set(source.names):
for find_spec in self._BuildFindSpecsFromArtifactDefinition(
yield from self._BuildFindSpecsFromArtifactDefinition(
source_name, environment_variables=environment_variables,
user_accounts=user_accounts):
yield find_spec
user_accounts=user_accounts)

elif source_type in (
artifacts_definitions.TYPE_INDICATOR_DIRECTORY,
artifacts_definitions.TYPE_INDICATOR_FILE,
artifacts_definitions.TYPE_INDICATOR_PATH):
for source_path in set(source.paths):
for find_spec in self._BuildFindSpecsFromFileSourcePath(
yield from self._BuildFindSpecsFromFileSourcePath(
source_path, source.separator,
environment_variables=environment_variables,
user_accounts=user_accounts):
yield find_spec
user_accounts=user_accounts)

def _BuildFindSpecsFromFileSourcePath(
self, source_path, path_separator, environment_variables=None,
Expand Down Expand Up @@ -145,7 +143,6 @@ def GetFindSpecs(
user_accounts = self._user_accounts

for name in set(names or []):
for find_spec in self._BuildFindSpecsFromArtifactDefinition(
yield from self._BuildFindSpecsFromArtifactDefinition(
name, environment_variables=environment_variables,
user_accounts=user_accounts):
yield find_spec
user_accounts=user_accounts)
9 changes: 3 additions & 6 deletions dfimagetools/file_entry_lister.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ def _ListFileEntry(self, file_system, file_entry, parent_path_segments):
yield file_entry, path_segments

for sub_file_entry in file_entry.sub_file_entries:
for result in self._ListFileEntry(
file_system, sub_file_entry, path_segments):
yield result
yield from self._ListFileEntry(file_system, sub_file_entry, path_segments)

def GetWindowsDirectory(self, base_path_spec):
"""Retrieves the Windows directory from the base path specification.
Expand Down Expand Up @@ -166,9 +164,8 @@ def ListFileEntries(self, base_path_specs):
base_path_segments.insert(0, '')
base_path_segments.pop()

for result in self._ListFileEntry(
file_system, file_entry, base_path_segments):
yield result
yield from self._ListFileEntry(
file_system, file_entry, base_path_segments)

def ListFileEntriesWithFindSpecs(self, base_path_specs, find_specs):
"""Lists file entries in the base path specifications.
Expand Down
2 changes: 0 additions & 2 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# -*- coding: utf-8 -*-
"""Script to run the tests."""

from __future__ import print_function

import sys
import unittest

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = dfimagetools
version = 20240317
version = 20241006
description = Storage media image tools
long_description = Collection of tools to process storage media images.
long_description_content_type = text/plain
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 7484aec

Please sign in to comment.