[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rubocop 192d976 02/64: An extremely basic RuboCop interfac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rubocop 192d976 02/64: An extremely basic RuboCop interface |
Date: |
Wed, 11 Aug 2021 10:07:53 -0400 (EDT) |
branch: elpa/rubocop
commit 192d9763f628d915ec6fd0da03c3dac273c6be12
Author: Bozhidar Batsov <bozhidar@tradeo.com>
Commit: Bozhidar Batsov <bozhidar@tradeo.com>
An extremely basic RuboCop interface
---
rubocop.el | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 86 insertions(+)
diff --git a/rubocop.el b/rubocop.el
new file mode 100644
index 0000000..4472b61
--- /dev/null
+++ b/rubocop.el
@@ -0,0 +1,86 @@
+;;; rubocop.el --- An Emacs interface for RuboCop
+
+;; Copyright © 2011-2013 Bozhidar Batsov
+
+;; Author: Bozhidar Batsov
+;; URL: https://github.com/bbatsov/rubocop-emacs
+;; Version: 0.1
+;; Keywords: project, convenience
+;; Package-Requires: ((dash "1.0.0"))
+
+;; This file is NOT part of GNU Emacs.
+
+;;; License:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+;;
+;; This library provides easy project management and navigation. The
+;; concept of a project is pretty basic - just a folder containing
+;; special file. Currently git, mercurial and bazaar repos are
+;; considered projects by default. If you want to mark a folder
+;; manually as a project just create an empty .projectile file in
+;; it. See the README for more details.
+;;
+;;; Code:
+
+(require 'dash)
+
+(defgroup rubocop nil
+ "An Emacs interface for RuboCop."
+ :group 'tools
+ :group 'convenience)
+
+(defvar rubocop-project-root-files
+ '(".projectile" ".git" ".hg" ".bzr" "_darcs" "Gemfile")
+ "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.
+The current directory is assumed to be the project's root otherwise."
+ (or (->> rubocop-project-root-files
+ (--map (locate-dominating-file default-directory it))
+ (-remove #'null)
+ (car))
+ (error "You're not into a project")))
+
+(defun rubocop-buffer-name (file-or-dir)
+ "Generate a name for the RuboCop buffer from FILE-OR-DIR."
+ (concat "*RuboCop " file-or-dir "*"))
+
+(defun rubocop-run-on-project ()
+ "Run on current project."
+ (interactive)
+ (compilation-start
+ (concat "rubocop -es " (rubocop-project-root))
+ 'compilation-mode
+ (lambda (arg) (message arg) (rubocop-buffer-name (rubocop-project-root)))))
+
+(defun rubocop-run-on-current-file ()
+ "Run on current file."
+ (interactive)
+ (let ((file-name (buffer-file-name (current-buffer))))
+ (if file-name
+ (compilation-start
+ (concat "rubocop -es " file-name)
+ 'compilation-mode
+ (lambda (arg) (rubocop-buffer-name file-name)))
+ (error "Buffer is not visiting a file"))))
+
+(provide 'rubocop)
+
+;;; rubocop.el ends here
- [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, 2021/08/11
- [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 <=
- [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
- [nongnu] elpa/rubocop 4aeda22 14/64: Update README.md, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop a192b35 26/64: Fix autocorrect-project binding, ELPA Syncer, 2021/08/11
- [nongnu] elpa/rubocop b65a310 10/64: Merge pull request #3 from purcell/patch-1, ELPA Syncer, 2021/08/11