Skip to content

Commit 596db1b

Browse files
committed
fix lint error
1 parent 48b848b commit 596db1b

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

cpp_linter_hooks/clang_format.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import subprocess
2-
import sys
31
from argparse import ArgumentParser
42
from typing import Tuple
53

cpp_linter_hooks/clang_tidy.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import subprocess
2-
import sys
31
from argparse import ArgumentParser
42
from typing import Tuple
53

tests/test_clang_format.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22
from pathlib import Path
3-
from unittest.mock import patch, MagicMock
3+
from unittest.mock import patch
44

55
from cpp_linter_hooks.clang_format import run_clang_format, main
66

@@ -109,7 +109,7 @@ def test_verbose_output(tmp_path, capsys):
109109
mock_run.assert_called_once()
110110
call_args = mock_run.call_args
111111
assert call_args[1]["tool_name"] == "clang-format"
112-
assert call_args[1]["verbose"] == True
112+
assert call_args[1]["verbose"] is True
113113

114114

115115
def test_verbose_with_error(tmp_path, capsys):
@@ -137,7 +137,7 @@ def test_verbose_with_error(tmp_path, capsys):
137137
mock_run.assert_called_once()
138138
call_args = mock_run.call_args
139139
assert call_args[1]["tool_name"] == "clang-format"
140-
assert call_args[1]["verbose"] == True
140+
assert call_args[1]["verbose"] is True
141141

142142

143143
def test_verbose_dry_run(tmp_path, capsys):
@@ -165,5 +165,5 @@ def test_verbose_dry_run(tmp_path, capsys):
165165
mock_run.assert_called_once()
166166
call_args = mock_run.call_args
167167
assert call_args[1]["tool_name"] == "clang-format"
168-
assert call_args[1]["verbose"] == True
169-
assert call_args[1]["dry_run"] == True
168+
assert call_args[1]["verbose"] is True
169+
assert call_args[1]["dry_run"] is True

tests/test_clang_tidy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22
import subprocess
33
from pathlib import Path
4-
from unittest.mock import patch, MagicMock
4+
from unittest.mock import patch
55

66
from cpp_linter_hooks.clang_tidy import run_clang_tidy
77

@@ -91,7 +91,7 @@ def test_verbose_output(tmp_path, capsys):
9191
mock_run.assert_called_once()
9292
call_args = mock_run.call_args
9393
assert call_args[1]["tool_name"] == "clang-tidy"
94-
assert call_args[1]["verbose"] == True
94+
assert call_args[1]["verbose"] is True
9595

9696

9797
def test_verbose_with_warnings(tmp_path, capsys):
@@ -122,7 +122,7 @@ def test_verbose_with_warnings(tmp_path, capsys):
122122
mock_run.assert_called_once()
123123
call_args = mock_run.call_args
124124
assert call_args[1]["tool_name"] == "clang-tidy"
125-
assert call_args[1]["verbose"] == True
125+
assert call_args[1]["verbose"] is True
126126

127127

128128
def test_verbose_with_file_not_found(capsys):
@@ -148,4 +148,4 @@ def test_verbose_with_file_not_found(capsys):
148148
mock_run.assert_called_once()
149149
call_args = mock_run.call_args
150150
assert call_args[1]["tool_name"] == "clang-tidy"
151-
assert call_args[1]["verbose"] == True
151+
assert call_args[1]["verbose"] is True

0 commit comments

Comments
 (0)