[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rubocop 7026b86 04/64: Make rubocop.el usable :-)
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rubocop 7026b86 04/64: Make rubocop.el usable :-) |
Date: |
Wed, 11 Aug 2021 10:07:54 -0400 (EDT) |
branch: elpa/rubocop
commit 7026b866b0cabd897e0f44aff8ccbdf9ff427898
Author: Bozhidar Batsov <bozhidar@tradeo.com>
Commit: Bozhidar Batsov <bozhidar@tradeo.com>
Make rubocop.el usable :-)
---
README.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
rubocop.el | 19 ++++++++++++++-----
2 files changed, 74 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index e69de29..192c1f7 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,60 @@
+# Synopsis
+
+A simple Emacs interface for [RuboCop](https://github.com/bbatsov/rubocop).
+
+# Installation
+
+## Manual
+
+Just drop `rubocop.el` and `dash.el`. somewhere in your `load-path`. I
+favour the folder `~/.emacs.d/vendor`:
+
+```lisp
+(add-to-list 'load-path "~/emacs.d/vendor")
+(require 'rubocop)
+```
+
+## Marmalade
+
+If you're an Emacs 24 user or you have a recent version of package.el
+you can install rubocop.el from the [Marmalade](http://marmalade-repo.org/)
repository.
+
+## MELPA
+
+If you're an Emacs 24 user or you have a recent version of package.el
+you can install rubocop.el from the [MELPA](http://melpa.milkbox.net/)
repository.
+
+## Emacs Prelude
+
+`rubocop.el` is naturally part of the
+[Emacs Prelude](https://github.com/bbatsov/prelude). If you're a Prelude
+user - `rubocop.el` is already properly configured and ready for
+action.
+
+# Usage
+
+<kbd>M-x rubocop-run-on-project</kbd>
+
+<kbd>M-x rubocop-run-on-directory</kbd>
+
+<kbd>M-x rubocop-run-on-current-file</kbd>
+
+# Known issues
+
+Check out the project's
+[issue
list](https://github.com/bbatsov/rubocop-emacs/issues?sort=created&direction=desc&state=open)
+a list of unresolved issues. By the way - feel free to fix any of them
+and send me a pull request. :-)
+
+# Contributors
+
+Here's a [list](https://github.com/bbatsov/rubocop-emacs/contributors) of all
the people who have contributed to the
+development of rubocop.el.
+
+# Bugs & Improvements
+
+Bug reports and suggestions for improvements are always
+welcome. GitHub pull requests are even better! :-)
+
+Cheers,<br/>
+[Bozhidar](http://twitter.com/bbatsov)
diff --git a/rubocop.el b/rubocop.el
index 1b0fd3d..fca4ffb 100644
--- a/rubocop.el
+++ b/rubocop.el
@@ -50,7 +50,7 @@
"A list of files considered to mark the root of a project.")
(defun rubocop-project-root ()
- "Retrieves the root directory of a project if available.
+ "Retrieve the root directory of a project if available.
The current directory is assumed to be the project's root otherwise."
(or (->> rubocop-project-root-files
(--map (locate-dominating-file default-directory it))
@@ -65,11 +65,20 @@ The current directory is assumed to be the project's root
otherwise."
(defun rubocop-run-on-project ()
"Run on current project."
(interactive)
+ (rubocop-run-on-directory (rubocop-project-root)))
+
+(defun rubocop-run-on-directory (&optional directory)
+ "Run on DIRECTORY if present.
+Alternatively prompt user for directory."
+ (interactive)
(rubocop-ensure-installed)
- (compilation-start
- (concat "rubocop -es " (rubocop-project-root))
- 'compilation-mode
- (lambda (arg) (message arg) (rubocop-buffer-name (rubocop-project-root)))))
+ (let ((directory
+ (or directory
+ (read-directory-name "Select directory:"))))
+ (compilation-start
+ (concat "rubocop -es " directory)
+ 'compilation-mode
+ (lambda (arg) (message arg) (rubocop-buffer-name directory)))))
(defun rubocop-run-on-current-file ()
"Run on current file."
- [nongnu] branch elpa/rubocop created (now f5fd18a), ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop f493961 03/64: Check for the presence of the rubocop binary, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 7026b86 04/64: Make rubocop.el usable :-),
ELPA Syncer <=
- [nongnu] elpa/rubocop 88d1bbf 09/64: Change commentary so that it doesn't describe projectile, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop c620a0c 11/64: Add auto-correction commands, minor mode and a default keymap, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 192d976 02/64: An extremely basic RuboCop interface, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 1e77d3f 18/64: add missing period, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 7446469 21/64: Merge pull request #11 from rranelli/master, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 2b782ec 23/64: Merge pull request #13 from ojab/master, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 405e0fd 28/64: Bump version to 0.4.0, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 14ab46a 01/64: first commit, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop fb98804 24/64: Load tramp dependency, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop 322564d 07/64: Update for RuboCop 0.9 (fixes #1) - update rubocop-on-current-file, ELPA Syncer, 2021/08/11