Skip to content

Commit

Permalink
pylint: remove unnecessary disable comments
Browse files Browse the repository at this point in the history
Change-Id: I7e713afb4c58d6dea7ac834f81f0d7a60106e54e
  • Loading branch information
volans- committed Sep 14, 2021
1 parent 116e8f4 commit e1dc641
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion cumin/backends/puppetdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def _parse_token(self, token):
raise InvalidQueryError(
"No valid key found in token, one of bool|hosts|category expected: {token}".format(token=token_dict))

def _get_resource_query(self, key, value=None, operator='='): # pylint: disable=no-self-use
def _get_resource_query(self, key, value=None, operator='='):
"""Build a resource query based on the parameters, resolving the special cases for ``%params`` and ``@field``.
Arguments:
Expand Down
8 changes: 4 additions & 4 deletions cumin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import signal
import sys

from logging.handlers import RotatingFileHandler # pylint: disable=ungrouped-imports
from logging.handlers import RotatingFileHandler

from tqdm import tqdm

Expand All @@ -20,7 +20,7 @@
from cumin.transports.clustershell import TqdmQuietReporter


logger = logging.getLogger(__name__) # pylint: disable=invalid-name
logger = logging.getLogger(__name__)
"""logging.Logger: The logging instance."""
OUTPUT_FORMATS = ('txt', 'json')
"""tuple: A tuple with the possible output formats."""
Expand Down Expand Up @@ -254,7 +254,7 @@ def sigint_handler(*args): # pylint: disable=unused-argument
signum: the signal number
frame: the current stack frame
"""
if not sys.stdout.isatty(): # pylint: disable=no-member
if not sys.stdout.isatty():
logger.warning('Execution interrupted by Ctrl+c/SIGINT')
raise KeyboardInterruptError

Expand Down Expand Up @@ -327,7 +327,7 @@ def get_hosts(args, config):
stderr('FORCE mode enabled, continuing without confirmation')
return hosts

if not sys.stdout.isatty(): # pylint: disable=no-member
if not sys.stdout.isatty():
message = 'Not in a TTY but neither DRY-RUN nor FORCE mode were specified.'
stderr(message)
raise cumin.CuminError(message)
Expand Down
5 changes: 1 addition & 4 deletions cumin/tests/integration/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
"""CLI integration tests."""
# pylint: disable=protected-access


import copy
import json
import os
Expand Down Expand Up @@ -204,7 +201,7 @@ def get_rc(params):
return return_value


def get_global_timeout_expected_lines(params): # pylint: disable=invalid-name
def get_global_timeout_expected_lines(params):
"""Return a list of expected lines labels for global timeout-based tests.
Arguments:
Expand Down
1 change: 0 additions & 1 deletion cumin/tests/unit/backends/test_puppetdb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""PuppetDB backend tests."""
# pylint: disable=invalid-name
from unittest import mock

import pytest
Expand Down
1 change: 0 additions & 1 deletion cumin/tests/unit/test_init.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Cumin package tests."""
# pylint: disable=invalid-name
import importlib
import logging
import os
Expand Down
2 changes: 0 additions & 2 deletions cumin/tests/unit/test_query.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Query handling tests."""
# pylint: disable=invalid-name

import pytest

from cumin import backends, nodeset
Expand Down
8 changes: 4 additions & 4 deletions cumin/tests/unit/transports/test_clustershell.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""ClusterShell transport tests."""
# pylint: disable=invalid-name,no-member,protected-access,attribute-defined-outside-init
# pylint: disable=no-member,protected-access,attribute-defined-outside-init
from unittest import mock

import pytest
Expand Down Expand Up @@ -52,7 +52,7 @@ class TestClusterShellWorker:
"""ClusterShell backend worker test class."""

@mock.patch('cumin.transports.clustershell.Task.task_self')
def setup_method(self, _, task_self): # pylint: disable=arguments-differ
def setup_method(self, _, task_self):
"""Initialize default properties and instances."""
self.config = {
'clustershell': {
Expand Down Expand Up @@ -236,7 +236,7 @@ def iter_buffers():
class TestBaseEventHandler:
"""BaseEventHandler test class."""

def setup_method(self, *args): # pylint: disable=arguments-differ
def setup_method(self, *args):
"""Initialize default properties and instances."""
self.target = Target(nodeset('node[1-2]'))
self.commands = [Command('command1', ok_codes=[0, 100]), Command('command2', timeout=5)]
Expand Down Expand Up @@ -434,7 +434,7 @@ class TestAsyncEventHandler(TestBaseEventHandler):

@mock.patch('cumin.transports.clustershell.logging')
@mock.patch('cumin.transports.clustershell.tqdm')
def setup_method(self, _, tqdm, logger): # pylint: disable=arguments-differ,unused-argument
def setup_method(self, _, tqdm, logger): # pylint: disable=arguments-differ
"""Initialize default properties and instances."""
super().setup_method()
self.handler = clustershell.AsyncEventHandler(self.target, self.commands, TqdmReporter(),
Expand Down
2 changes: 1 addition & 1 deletion cumin/transports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ def handler(self):

@handler.setter # type: ignore
@abstractmethod
def handler(self, value): # pylint: disable=property-with-parameters; https://github.com/PyCQA/pylint/issues/3600
def handler(self, value):
"""Setter for the `handler` property. The relative documentation is in the getter."""

@property
Expand Down

0 comments on commit e1dc641

Please sign in to comment.