[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rubocop 1285711 44/64: [Fix #22] Add a clean way to load R
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rubocop 1285711 44/64: [Fix #22] Add a clean way to load RuboCop extensions |
Date: |
Wed, 11 Aug 2021 10:08:02 -0400 (EDT) |
branch: elpa/rubocop
commit 1285711c6a2651e1831651c528af5697876d5497
Author: Bozhidar Batsov <bozhidar@batsov.com>
Commit: Bozhidar Batsov <bozhidar@batsov.com>
[Fix #22] Add a clean way to load RuboCop extensions
---
rubocop.el | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/rubocop.el b/rubocop.el
index a7c7e37..1e123d3 100644
--- a/rubocop.el
+++ b/rubocop.el
@@ -58,6 +58,11 @@
"The command used to run RuboCop's autocorrection."
:type 'string)
+(defcustom rubocop-extensions
+ '()
+ "A list of extensions to be loaded by RuboCop."
+ :type '(repeat string))
+
(defcustom rubocop-keymap-prefix (kbd "C-c C-r")
"RuboCop keymap prefix."
:group 'rubocop
@@ -89,10 +94,27 @@ When NO-ERROR is non-nil returns nil instead of raise an
error."
"Generate a name for the RuboCop buffer from FILE-OR-DIR."
(concat "*RuboCop " file-or-dir "*"))
+(defun rubocop-build-requires ()
+ "Build RuboCop requires from `rubocop-extensions'."
+ (if rubocop-extensions
+ (concat
+ (mapconcat
+ (lambda (ext)
+ (format "--require %s" ext))
+ rubocop-extensions
+ " ")
+ " ")
+ ""))
+
(defun rubocop-build-command (command path)
"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 " "") command " " path))
+ (concat
+ (if (rubocop-bundled-p) "bundle exec " "")
+ command
+ (rubocop-build-requires)
+ " "
+ path))
(defun rubocop--dir-command (command &optional directory)
"Run COMMAND on DIRECTORY (if present).
- [nongnu] elpa/rubocop 07ad97a 63/64: Update some metadata, (continued)
- [nongnu] elpa/rubocop 07ad97a 63/64: Update some metadata, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop c2a4c79 32/64: Update copyright years, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 4219890 34/64: Use #' where applicable, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 9097535 46/64: Update the copyright years, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop b921bec 08/64: Merge pull request #2 from nodo/master, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 6f4928d 15/64: Merge pull request #4 from arthurnn/patch-1, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop c549052 31/64: Merge pull request #19 from syohex/byte-compile-warning, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop fb20a88 33/64: Tweak some docstrings, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop c0cb592 37/64: Kill the dash.el dependency, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 4fdf643 40/64: Add missing space, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 1285711 44/64: [Fix #22] Add a clean way to load RuboCop extensions,
ELPA Syncer <=
- [nongnu] elpa/rubocop d4dad32 48/64: Add missing space, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 080454e 54/64: Add a note about rubocop-keymap-prefix, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 6c9c5a9 55/64: Add a bunch of commands for code formatting, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop f5fd18a 64/64: Add the ability to format on save, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop b0c5bc2 62/64: Tweak a heading, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 608a3c1 58/64: Release 0.6.0, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 0131536 39/64: Fix a docstring, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 1372ee3 60/64: Tweak some wording, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 2c884cd 25/64: Merge pull request #15 from fap-/load_tramp_dependency, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop f947fb0 30/64: Fix byte-compile warning about unused variable, ELPA Syncer, 2021/08/11