Update Dockerfile handling to keep parser directives at the top

Signed-off-by: CrazyMax <google@crazymax.dev>
This commit is contained in:
CrazyMax
2021-08-09 21:04:55 +02:00
committed by Will Norris
parent 5be3beef79
commit 99ebc9c9db
8 changed files with 46 additions and 0 deletions

View File

@@ -242,6 +242,8 @@ func TestAddLicense(t *testing.T) {
{"# encoding: UTF-8\ncontent", "# encoding: UTF-8\n// HYS\n\ncontent", true},
{"# frozen_string_literal: true\ncontent", "# frozen_string_literal: true\n// HYS\n\ncontent", true},
{"<?php\ncontent", "<?php\n// HYS\n\ncontent", true},
{"# escape: `\ncontent", "# escape: `\n// HYS\n\ncontent", true},
{"# syntax: docker/dockerfile:1.3\ncontent", "# syntax: docker/dockerfile:1.3\n// HYS\n\ncontent", true},
// ensure files with existing license or generated files are
// skipped. No need to test all permutations of these, since