MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / test_does_not_reformat

Function test_does_not_reformat

tests/commands/autoupdate_test.py:284–299  ·  view source on GitHub ↗
(tmpdir, out_of_date)

Source from the content-addressed store, hash-verified

282
283
284def test_does_not_reformat(tmpdir, out_of_date):
285 fmt = (
286 'repos:\n'
287 '- repo: {}\n'
288 ' rev: {} # definitely the version I want!\n'
289 ' hooks:\n'
290 ' - id: foo\n'
291 ' # These args are because reasons!\n'
292 ' args: [foo, bar, baz]\n'
293 )
294 cfg = tmpdir.join(C.CONFIG_FILE)
295 cfg.write(fmt.format(out_of_date.path, out_of_date.original_rev))
296
297 assert autoupdate(str(cfg), freeze=False, tags_only=False) == 0
298 expected = fmt.format(out_of_date.path, out_of_date.head_rev)
299 assert cfg.read() == expected
300
301
302def test_does_not_change_mixed_endlines_read(up_to_date, tmpdir):

Callers

nothing calls this directly

Calls 1

autoupdateFunction · 0.90

Tested by

no test coverage detected