From ca341b18a240c7e9d33abf2b3b9c1bce66ac44b9 Mon Sep 17 00:00:00 2001 From: Jonathan Delgado Date: Wed, 28 Feb 2018 16:11:35 -0800 Subject: [PATCH] Add: resolve_symlinks option --- TodoReview.py | 5 ++++- TodoReview.sublime-settings | 1 + readme.md | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/TodoReview.py b/TodoReview.py index 47789b0..efc3a36 100644 --- a/TodoReview.py +++ b/TodoReview.py @@ -113,7 +113,10 @@ def process(self): return self.extract(self.files()) def resolve(self, directory): - return os.path.realpath(os.path.expanduser(os.path.abspath(directory))) + if settings.get('resolve_symlinks', True): + return os.path.realpath(os.path.expanduser(os.path.abspath(directory))) + else: + return os.path.expanduser(os.path.abspath(directory)) class Thread(threading.Thread): def __init__(self, engine, callback): diff --git a/TodoReview.sublime-settings b/TodoReview.sublime-settings index ccd80da..ed4eb16 100644 --- a/TodoReview.sublime-settings +++ b/TodoReview.sublime-settings @@ -11,6 +11,7 @@ "*.sublime-workspace", "*.sublime-project" ], + "resolve_symlinks": true, "case_sensitive": false, "render_include_folder": true, "render_folder_depth": 1, diff --git a/readme.md b/readme.md index 7ba8039..88a9a0d 100644 --- a/readme.md +++ b/readme.md @@ -138,6 +138,13 @@ Though it may be unnecessary for most, I've also included a setting to override ] ``` +## Resolve Symlinks +TodoReview tries to resolve symlinks in your projects so the actual file on disk is referenced. This behavior cuts down on a lot of issues related to symlinks being malformed, for instance having a non-existent destination. This might not work with all workflows, for example working with remote servers. For that reason, you are able to set how you want symlinks handled by TodoReview. This is more of an advanced setting, if you aren't getting errors about symlinks, you most likely do not need to change this. The default is `true`. + +```javascript +"resolve_symlinks": false +``` + ## Case Sensitive By default, searching is not case sensitive. If you would like it to force case, you can add the following to your config. This defaults to `false`.