File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ package ignore
2
+
3
+ import (
4
+ "github.com/windmilleng/tilt/internal/dockerignore"
5
+ "github.com/windmilleng/tilt/internal/model"
6
+ )
7
+
8
+ // Filter out spurious changes that we don't want to rebuild on, like IDE
9
+ // temp/lock files.
10
+ //
11
+ // This isn't an ideal solution. In an ideal world, the user would put
12
+ // everything to ignore in their tiltignore/dockerignore files. This is a
13
+ // stop-gap so they don't have a terrible experience if those files aren't
14
+ // there or aren't in the right places.
15
+ //
16
+ // https://app.clubhouse.io/windmill/story/691/filter-out-ephemeral-file-changes
17
+ var ephemeralPathMatcher = initEphemeralPathMatcher ()
18
+
19
+ func initEphemeralPathMatcher () model.PathMatcher {
20
+ golandPatterns := []string {"**/*___jb_old___" , "**/*___jb_tmp___" }
21
+ emacsPatterns := []string {"**/.#*" }
22
+ vimPatterns := []string {"**/4913" , "**/*~" , "**/.*.swp" , "**/.*.swx" }
23
+
24
+ allPatterns := []string {}
25
+ allPatterns = append (allPatterns , golandPatterns ... )
26
+ allPatterns = append (allPatterns , emacsPatterns ... )
27
+ allPatterns = append (allPatterns , vimPatterns ... )
28
+
29
+ matcher , err := dockerignore .NewDockerPatternMatcher ("/" , allPatterns )
30
+ if err != nil {
31
+ panic (err )
32
+ }
33
+ return matcher
34
+ }
You can’t perform that action at this time.
0 commit comments