(cap_out, store, in_git_dir)
| 249 | |
| 250 | |
| 251 | def test_global_exclude(cap_out, store, in_git_dir): |
| 252 | config = { |
| 253 | 'exclude': r'^foo\.py$', |
| 254 | 'repos': [{'repo': 'meta', 'hooks': [{'id': 'identity'}]}], |
| 255 | } |
| 256 | write_config('.', config) |
| 257 | open('foo.py', 'a').close() |
| 258 | open('bar.py', 'a').close() |
| 259 | cmd_output('git', 'add', '.') |
| 260 | opts = run_opts(verbose=True) |
| 261 | ret, printed = _do_run(cap_out, store, str(in_git_dir), opts) |
| 262 | assert ret == 0 |
| 263 | # Does not contain foo.py since it was excluded |
| 264 | assert printed.startswith(f'identity{"." * 65}Passed\n'.encode()) |
| 265 | assert printed.endswith(b'\n\n.pre-commit-config.yaml\nbar.py\n\n') |
| 266 | |
| 267 | |
| 268 | def test_global_files(cap_out, store, in_git_dir): |
nothing calls this directly
no test coverage detected