@@ -29,9 +29,9 @@ def test_ensure_gitignore_empty_file(self, mock_exists, mock_file):
2929 mock_file .assert_any_call (Path (".gitignore" ), "w" )
3030
3131 # Check the written content
32- write_call = [
33- call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]
34- ][ - 1 ]
32+ write_call = [call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]][
33+ - 1
34+ ]
3535 written_content = write_call [0 ][0 ]
3636 assert ".claude/settings.local.json\n " == written_content
3737
@@ -56,9 +56,9 @@ def test_ensure_gitignore_existing_content(self, mock_exists, mock_file):
5656 mock_file .assert_any_call (Path (".gitignore" ), "w" )
5757
5858 # Check the written content includes existing and new patterns
59- write_call = [
60- call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]
61- ][ - 1 ]
59+ write_call = [call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]][
60+ - 1
61+ ]
6262 written_content = write_call [0 ][0 ]
6363 assert "node_modules/\n *.log\n .claude/settings.local.json\n " == written_content
6464
@@ -118,9 +118,9 @@ def test_ensure_gitignore_whitespace_only_file(self, mock_exists, mock_file):
118118 mock_file .assert_any_call (Path (".gitignore" ), "w" )
119119
120120 # Check the written content
121- write_call = [
122- call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]
123- ][ - 1 ]
121+ write_call = [call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]][
122+ - 1
123+ ]
124124 written_content = write_call [0 ][0 ]
125125 assert ".claude/settings.local.json\n " == written_content
126126
@@ -130,9 +130,7 @@ def test_ensure_gitignore_whitespace_only_file(self, mock_exists, mock_file):
130130 read_data = "node_modules/\n # Comment\n \n *.log\n " ,
131131 )
132132 @patch ("claude_setup.gitignore_manager.Path.exists" )
133- def test_ensure_gitignore_with_comments_and_empty_lines (
134- self , mock_exists , mock_file
135- ):
133+ def test_ensure_gitignore_with_comments_and_empty_lines (self , mock_exists , mock_file ):
136134 """Test handling .gitignore with comments and empty lines."""
137135 # Arrange
138136 mock_exists .return_value = True
@@ -145,9 +143,9 @@ def test_ensure_gitignore_with_comments_and_empty_lines(
145143 assert mock_file .call_count == 2
146144
147145 # Check the written content preserves structure
148- write_call = [
149- call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]
150- ][ - 1 ]
146+ write_call = [call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]][
147+ - 1
148+ ]
151149 written_content = write_call [0 ][0 ]
152150 expected = "node_modules/\n # Comment\n \n *.log\n .claude/settings.local.json\n "
153151 assert expected == written_content
@@ -209,9 +207,7 @@ def test_ensure_gitignore_similar_pattern_exists(self, mock_exists, mock_file):
209207 read_data = "node_modules/\n .claude/settings.local.json \n *.log\n " ,
210208 )
211209 @patch ("claude_setup.gitignore_manager.Path.exists" )
212- def test_ensure_gitignore_pattern_with_trailing_spaces (
213- self , mock_exists , mock_file
214- ):
210+ def test_ensure_gitignore_pattern_with_trailing_spaces (self , mock_exists , mock_file ):
215211 """Test that trailing spaces in existing pattern don't match."""
216212 # Arrange
217213 mock_exists .return_value = True
@@ -227,9 +223,9 @@ def test_ensure_gitignore_pattern_with_trailing_spaces(
227223
228224 # Check that the pattern was added despite similar line
229225 # with trailing spaces
230- write_call = [
231- call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]
232- ][ - 1 ]
226+ write_call = [call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]][
227+ - 1
228+ ]
233229 written_content = write_call [0 ][0 ]
234230 assert ".claude/settings.local.json" in written_content
235231 # Should have both the original line with spaces and the new clean line
@@ -270,8 +266,8 @@ def test_ensure_gitignore_no_trailing_newline(self, mock_exists, mock_file):
270266 assert mock_file .call_count == 2
271267
272268 # Check the written content adds pattern properly
273- write_call = [
274- call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]
275- ][ - 1 ]
269+ write_call = [call for call in mock_file . return_value . write . call_args_list if call [ 0 ][ 0 ]][
270+ - 1
271+ ]
276272 written_content = write_call [0 ][0 ]
277273 assert "line1\n line2\n line3\n .claude/settings.local.json\n " == written_content
0 commit comments