branch: elpa/rubocop
commit 32f8b082c9983990a82f9524740878a80c28d5cc
Author: Daniel Luna <d...@chime.com>
Commit: Bozhidar Batsov <bozhidar.bat...@gmail.com>

    Use nonbundled rubocop if rubocop-prefer-system-executable is set
---
 rubocop.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rubocop.el b/rubocop.el
index 6c83e28..26913f4 100644
--- a/rubocop.el
+++ b/rubocop.el
@@ -68,6 +68,11 @@
   :group 'rubocop
   :type 'string)
 
+(defcustom rubocop-prefer-system-executable nil
+  "Runs rubocop with the system executable even if inside a bundled project."
+  :group 'rubocop
+  :type 'boolean)
+
 (defun rubocop-local-file-name (file-name)
   "Retrieve local filename if FILE-NAME is opened via TRAMP."
   (cond ((tramp-tramp-file-p file-name)
@@ -111,7 +116,7 @@ When NO-ERROR is non-nil returns nil instead of raise an 
error."
   "Build the full command to be run based on COMMAND and PATH.
 The command will be prefixed with `bundle exec` if RuboCop is bundled."
   (concat
-   (if (rubocop-bundled-p) "bundle exec " "")
+   (if (and (not rubocop-prefer-system-executable) (rubocop-bundled-p)) 
"bundle exec " "")
    command
    (rubocop-build-requires)
    " "

Reply via email to