code: func (s *SourceSpec) IgnoreFile(filename string) bool {
  	if filename == "" {
  		if _, ok := s.SourceFs.(*afero.OsFs); ok {
  			return true
  		}
  		return false
  	}
  
  	base := filepath.Base(filename)
  
  	if len(base) > 0 {
  		first := base[0]
  		last := base[len(base)-1]
  		if first == '.' ||
  			first == '#' ||
  			last == '~' {
  			return true
  		}
  	}
  
  	if len(s.ignoreFilesRe) == 0 {
  		return false
  	}
  
  	for _, re := range s.ignoreFilesRe {
  		if re.MatchString(filename) {
  			return true
  		}
  	}
  
  	return false
  }
docs: // IgnoreFile returns whether a given file should be ignored.