MCPcopy
hub / github.com/hashicorp/packer / shouldIgnoreFile

Method shouldIgnoreFile

hcl2template/formatter.go:185–189  ·  view source on GitHub ↗

shouldIgnoreFile returns true if the given filename (which must not have a directory path ahead of it) should be ignored as e.g. an editor swap file.

(name string)

Source from the content-addressed store, hash-verified

183// shouldIgnoreFile returns true if the given filename (which must not have a
184// directory path ahead of it) should be ignored as e.g. an editor swap file.
185func (f *HCL2Formatter) shouldIgnoreFile(name string) bool {
186 return strings.HasPrefix(name, ".") || // Unix-like hidden files
187 strings.HasSuffix(name, "~") || // vim
188 strings.HasPrefix(name, "#") && strings.HasSuffix(name, "#") // emacs
189}
190
191// bytesDiff returns the unified diff of b1 and b2
192// Shamelessly copied from Terraform's fmt command.

Callers 1

FormatMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected