Skip to content

Commit

Permalink
Code review: 342770043: Fixed linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Mar 21, 2018
1 parent 7af0c84 commit 2cf0946
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/dpkg/changelog
Expand Up @@ -2,4 +2,4 @@ plaso (20180321-1) unstable; urgency=low

* Auto-generated

-- Log2Timeline <log2timeline-dev@googlegroups.com> Wed, 21 Mar 2018 19:00:48 +0100
-- Log2Timeline <log2timeline-dev@googlegroups.com> Wed, 21 Mar 2018 19:11:35 +0100
4 changes: 4 additions & 0 deletions plaso/engine/processing_status.py
Expand Up @@ -354,6 +354,7 @@ def workers_status(self):
return [self._workers_status[identifier]
for identifier in sorted(self._workers_status.keys())]

# pylint: disable=too-many-arguments
def _UpdateProcessStatus(
self, process_status, identifier, status, pid, used_memory, display_name,
number_of_consumed_sources, number_of_produced_sources,
Expand Down Expand Up @@ -417,6 +418,7 @@ def _UpdateProcessStatus(
new_reports):
process_status.last_running_time = time.time()

# pylint: disable=too-many-arguments
def UpdateForemanStatus(
self, identifier, status, pid, used_memory, display_name,
number_of_consumed_sources, number_of_produced_sources,
Expand Down Expand Up @@ -465,6 +467,7 @@ def UpdateForemanStatus(
number_of_consumed_errors, number_of_produced_errors,
number_of_consumed_reports, number_of_produced_reports)

# pylint: disable=too-many-arguments
def UpdateTasksStatus(self, tasks_status):
"""Updates the tasks status.
Expand All @@ -473,6 +476,7 @@ def UpdateTasksStatus(self, tasks_status):
"""
self.tasks_status = tasks_status

# pylint: disable=too-many-arguments
def UpdateWorkerStatus(
self, identifier, status, pid, used_memory, display_name,
number_of_consumed_sources, number_of_produced_sources,
Expand Down
1 change: 1 addition & 0 deletions plaso/lib/line_reader_file.py
Expand Up @@ -53,6 +53,7 @@ def __iter__(self):

# Note: that the following functions do not follow the style guide
# because they are part of the readline file-like object interface.
# pylint: disable=invalid-name

def readline(self, size=None):
"""Reads a single line of text.
Expand Down
6 changes: 4 additions & 2 deletions tests/analysis/nsrlsvr.py
Expand Up @@ -28,8 +28,10 @@ def __init__(self):
super(_MockNsrlsvrSocket, self).__init__()
self._data = None

# These methods are part of the socket interface, hence their names do not
# follow the Plaso style guide.
# Note: that the following functions do not follow the style guide
# because they are part of the socket interface.
# pylint: disable=invalid-name

def recv(self, unused_buffer_size):
"""Mocks the socket.recv method."""
expected_data = (
Expand Down
4 changes: 4 additions & 0 deletions tests/analysis/viper.py
Expand Up @@ -25,6 +25,10 @@
class MockResponse(dict):
"""A mock object to simulate a response object from the requests library."""

# Note: that the following functions do not follow the style guide
# because they are part of the requests response interface.
# pylint: disable=invalid-name

def json(self):
"""Provided for compatibility with the requests library."""
return self
Expand Down
4 changes: 4 additions & 0 deletions tests/analysis/virustotal.py
Expand Up @@ -25,6 +25,10 @@
class MockResponse(dict):
"""A mock object to simulate a response object from the requests library."""

# Note: that the following functions do not follow the style guide
# because they are part of the requests response interface.
# pylint: disable=invalid-name

def json(self):
"""Provided for compatibility with the requests library."""
return self
Expand Down
12 changes: 12 additions & 0 deletions tests/output/fake_mysqldb.py
Expand Up @@ -11,6 +11,10 @@ class Error(object):
class FakeMySQLdbConnection(object):
"""Fake implementation of MySQLdb Connection class for testing."""

# Note: that the following functions do not follow the style guide
# because they are part of the MySQL database connection interface.
# pylint: disable=invalid-name

def close(self):
"""Closes the connection."""
return
Expand Down Expand Up @@ -52,6 +56,10 @@ def __init__(self):
self.expected_query_args = None
self.query_results = []

# Note: that the following functions do not follow the style guide
# because they are part of the MySQL database cursor interface.
# pylint: disable=invalid-name

def close(self):
"""Closes the cursor."""
return
Expand Down Expand Up @@ -95,6 +103,10 @@ def fetchone(self):
return row


# Note: that the following functions do not follow the style guide
# because they are part of the MySQL database module interface.
# pylint: disable=invalid-name

def connect(
unused_hostname, unused_username, unused_password, unused_database_name):
"""Connects to the MySQL database server.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lib.py
Expand Up @@ -14,7 +14,7 @@
from dfvfs.resolver import resolver as path_spec_resolver


def skipUnlessHasTestFile(path_segments):
def skipUnlessHasTestFile(path_segments): # pylint: disable=invalid-name
"""Decorator to skip a test if the test file does not exist.
Args:
Expand Down

0 comments on commit 2cf0946

Please sign in to comment.