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)
| 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. |
| 185 | func (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. |