Skip to content

Commit 92c781f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 28f2d7d commit 92c781f

File tree

7 files changed

+33
-26
lines changed

7 files changed

+33
-26
lines changed

pylint_ml/checkers/matplotlib/matplotlib_parameter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ def _get_full_method_name(self, node: nodes.Call) -> str:
7575
if isinstance(func, nodes.Name):
7676
method_chain.insert(0, func.name)
7777

78-
return ".".join(method_chain)
78+
return ".".join(method_chain)

pylint_ml/checkers/numpy/numpy_dot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def visit_import(self, node: nodes.Import):
2929

3030
@only_required_for_messages("numpy-dot-usage")
3131
def visit_call(self, node: nodes.Call) -> None:
32-
if not self.is_library_imported('numpy'):
32+
if not self.is_library_imported("numpy"):
3333
return
3434

3535
# Check if the function being called is np.dot

pylint_ml/util/library_handler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ def visit_import(self, node):
1111
for name, alias in node.names:
1212
self.imports[alias or name] = name
1313

14-
def visit_importfrom(self, node, ):
14+
def visit_importfrom(
15+
self,
16+
node,
17+
):
1518
# TODO Update method to handle either:
1619
# 1. Check of specific method-name imported?
1720
# 2. Store all method names importfrom libname?

tests/checkers/test_numpy/test_numpy_dot.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,22 @@ class TestNumpyDotChecker(pylint.testutils.CheckerTestCase):
99
CHECKER_CLASS = NumpyDotChecker
1010

1111
def test_warning_for_dot(self):
12-
import_np, node = astroid.extract_node("""
12+
import_np, node = astroid.extract_node(
13+
"""
1314
import numpy as np #@
1415
a = np.array([1, 2])
1516
b = np.array([3, 4])
1617
np.dot(a, b) #@
17-
""")
18+
"""
19+
)
1820

1921
with self.assertAddsMessages(
20-
pylint.testutils.MessageTest(
21-
msg_id="numpy-dot-usage",
22-
node=node,
23-
confidence=HIGH,
24-
),
25-
ignore_position=True
22+
pylint.testutils.MessageTest(
23+
msg_id="numpy-dot-usage",
24+
node=node,
25+
confidence=HIGH,
26+
),
27+
ignore_position=True,
2628
):
2729
self.checker.visit_import(import_np)
2830
self.checker.visit_call(node)

tests/checkers/test_numpy/test_numpy_nan_comparison.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ class TestNumpyNaNComparison(pylint.testutils.CheckerTestCase):
99
CHECKER_CLASS = NumpyNaNComparisonChecker
1010

1111
def test_singleton_nan_compare(self):
12-
singleton_node, chained_node, great_than_node = astroid.extract_node("""
12+
singleton_node, chained_node, great_than_node = astroid.extract_node(
13+
"""
1314
a_nan = np.array([0, 1, np.nan])
1415
np.nan == a_nan #@
1516
1 == 1 == np.nan #@
1617
1 > 0 > np.nan #@
17-
""")
18+
"""
19+
)
1820

1921
with self.assertAddsMessages(
2022
pylint.testutils.MessageTest(

tests/checkers/test_pandas/test_pandas_import.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ def test_incorrect_pandas_import(self):
2626
)
2727

2828
with self.assertAddsMessages(
29-
pylint.testutils.MessageTest(
30-
msg_id="pandas-import",
31-
confidence=HIGH,
32-
node=pandas_import_node,
33-
),
34-
ignore_position=True,
29+
pylint.testutils.MessageTest(
30+
msg_id="pandas-import",
31+
confidence=HIGH,
32+
node=pandas_import_node,
33+
),
34+
ignore_position=True,
3535
):
3636
self.checker.visit_import(pandas_import_node)
3737

@@ -43,11 +43,11 @@ def test_incorrect_pandas_import_from(self):
4343
)
4444

4545
with self.assertAddsMessages(
46-
pylint.testutils.MessageTest(
47-
msg_id="pandas-importfrom",
48-
confidence=HIGH,
49-
node=pandas_importfrom_node,
50-
),
51-
ignore_position=True,
46+
pylint.testutils.MessageTest(
47+
msg_id="pandas-importfrom",
48+
confidence=HIGH,
49+
node=pandas_importfrom_node,
50+
),
51+
ignore_position=True,
5252
):
5353
self.checker.visit_importfrom(pandas_importfrom_node)

tests/checkers/test_pandas/test_pandas_series_bool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_series_bool_usage(self):
2222
confidence=HIGH,
2323
node=node,
2424
),
25-
ignore_position=True
25+
ignore_position=True,
2626
):
2727
self.checker.visit_call(node)
2828

0 commit comments

Comments
 (0)