Conversation
* Leverages the .sentry.yml to add a list of patterns for files to ignore from the watched file paths. This can be useful for developers whose editors produce temporary dotfiles (lock and/or autosave files) for which it may not be desired to watch.
20c499a to
55151cc
Compare
|
Hey sorry. been really busy recently. I'll set aside time to review this tonight or tomorrow. |
src/sentry_cli.cr
Outdated
| should_build: config.should_build?, | ||
| files: config.watch | ||
| files: config.watch, | ||
| ignore_regexes: config.ignore |
There was a problem hiding this comment.
I think ignore_regexes should just be ignore for the cli and the api.
55151cc to
fff3f32
Compare
- Skip caching timestamps for symbolic links by checking if `File.exists?(file)`. This resolves exception: `Unable to get stat for './src/my_file.cr': No such file or directory (Errno)` - Update API documentation with `ignore` reference - rename `ignore_regexes` to `ignore`
fff3f32 to
13dc29c
Compare
|
Yep, good call. I changed |
| # The list of patterns of files to ignore from the watched file paths. | ||
| ignore: | ||
| - /\.swp$/ | ||
| - /^\.#/ |
There was a problem hiding this comment.
I'm sorry, what does the # do? I'm looking at the pattern reference and don't see a hash character. You either meant * or I got some learning to do.
There was a problem hiding this comment.
Since these are strings that we have to cast to regex, does that mean we have to add extra backslashes to everything (e.g. \\w, \\/)?
There was a problem hiding this comment.
That example was inspired by the issue I was having with the emacs lock files. Those lock files take on the format, .#my_file.cr; So, that pattern filters them out (any file starting with .#). The example patterns here could be better I think 🤔.
Since we're reading in the sentry.yml with File.read, the escape backslashes are added automatically: \nignore:\n - /\\.swp$/\n - /^\\.#/\n".
|
I've got a case now where this would really simplify my Any chance this could get merged soon? |
Some editors produce temporary dotfiles for which it may not be desirable to watch. For example, Vim has swap files and Emacs has file locks. Some of these files may even cause problems for Sentry. For instance an Emacs file lock is symbolic link which causes Sentry to crash with:
Unable to get stat for './src/.#my_file.cr': No such file or directory (Errno)when attempting toget_timestamp(happened to me when doing Amber's Quick Start Guide). This PR address address both issues:File.exists?. Skip the scan if it does not..sentry.ymlto include aningorekey that can contain a list of patterns for files to ignore from the watched file paths.