Skip to content

Commit b2b528d

Browse files
tests/test_codespell.py: reduce length of codespell command line.
We use codespell's new @file arg.
1 parent a531669 commit b2b528d

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

tests/test_codespell.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,28 @@ def test_codespell():
4949
import pipcl
5050
finally:
5151
del sys.path[0]
52+
5253
git_files = pipcl.git_items(root)
5354

54-
for p in git_files:
55-
_, ext = os.path.splitext(p)
56-
if ext in ('.png', '.pdf', '.jpg', '.svg'):
57-
pass
58-
else:
59-
command += f' {p}\n'
55+
command_args_path = os.path.normpath(f'{__file__}/../test_codespell_args.txt')
56+
command += f' @{command_args_path}'
57+
58+
with open(command_args_path, 'w') as f:
59+
60+
for p in git_files:
61+
_, ext = os.path.splitext(p)
62+
if ext in ('.png', '.pdf', '.jpg', '.svg'):
63+
pass
64+
else:
65+
#command += f' {p}\n'
66+
print(p, file=f)
6067

6168
if platform.system() != 'Windows':
6269
command = command.replace('\n', ' \\\n')
63-
# Don't print entire command because very long, and will be displayed
64-
# anyway if there is an error.
65-
#print(f'test_codespell(): Running: {command}')
66-
print(f'Running codespell.')
70+
if 0:
71+
with open(command_args_path) as f:
72+
command_args_path_contents = f.read()
73+
print(f'command_args_path:{command_args_path_contents}')
74+
print(f'Running codespell: {command}')
6775
subprocess.run(command, shell=1, check=1)
6876
print('test_codespell(): codespell succeeded.')

0 commit comments

Comments
 (0)