-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore files #22
base: master
Are you sure you want to change the base?
Ignore files #22
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
@@ -81,7 +81,8 @@ if Sentry::Config.shard_name | |||
build_args: config.build_args, | |||
run_args: config.run_args, | |||
should_build: config.should_build?, | |||
files: config.watch | |||
files: config.watch, | |||
ignore_regexes: config.ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.yml
to include aningore
key that can contain a list of patterns for files to ignore from the watched file paths.