unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Bozhidar Batsov <bozhidar@batsov.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: "Petko Bordjukov" <bordjukov@gmail.com>,
	"João Távora" <joaotavora@gmail.com>,
	31760@debbugs.gnu.org
Subject: bug#31760: 26.1; ruby-mode enables flymake-rubocop by default if the rubocop executable exists
Date: Mon, 18 Jun 2018 17:09:00 +0300	[thread overview]
Message-ID: <CAM9Zgm0_Lv_xDG__-13TENHsR+CbYuBUK8qAhZ-RAyQxsZh3Gw@mail.gmail.com> (raw)
In-Reply-To: <4819c282-6132-e5d0-8771-0b558ee58e70@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 2894 bytes --]

I guess you can just look for .rubocop.yml in the root of the project.
That's not a precise way to infer if someone wants to use RuboCop, but it
should be good enough for most people (relatively few people have global
RuboCop configs).

I wonder if it won't be good to have a lint-mode only option as well -
generally `rubocop --lint` will show only things that are important to fix,
but it's much nicer than `ruby -w`. So, I'd still use rubocop for linting
if RuboCop is installed and use it for everything else only when the
project has some project config.

On Mon, 18 Jun 2018 at 17:02, Dmitry Gutov <dgutov@yandex.ru> wrote:

> On 6/16/18 6:32 PM, João Távora wrote:
>
> >    There was little discussion on this before 26.1 because it was all
> >    kinda rushed, because Dmitry is the maintainer of ruby-mode, and most
> >    importantly, nobody objected (much less I, who welcomed the enthusiasm
> >    for using the new API).  So even though Emacs 26.1 is a month old, the
> >    conservative stance is now to keep default.
>
> To be clear, I only did the most simple thing (and indeed, nobody
> objected). So anybody who doesn't like the behavior in 26.1, you're
> welcome to try out pretest versions. That's what they're for.
>
> That said, I'm totally fine with adding a new value for
> ruby-flymake-use-rubocop-if-available (like `auto'), and make it the
> default. Because I personally have also been hit by it turning on in
> projects where it's not exactly needed. Like Ruby Stdlib, certain gems,
> etc. And older projects, yes.
>
> I suggested the following already. Nobody responded to it so far:
>
> "I suppose we can abort if no ruby-rubocop-config file is found."
>
> Meaning, if there is no .rubocop.yml is any directory containing the
> current file, RuboCop is not used.
>
> The main reasons I'm putting this off is avoiding calling
> locate-dominating-file twice, while keeping the simplicity of having two
> different diagnostic functions available for user use, is a bit tricky.
>
> > * On the practical front, I personally dislike defcustom and prefer
> >    having flymake backends separate, so instead of having
> >    ruby-flymake-auto checks the defcustom, I advise Petko to use a
> >    directory-local variable in the project configuring
> >    flymake-diagnostic-functions to either ruby-flymake-simple or
> >    ruby-flymake-rubocop, i.e. some .dir-locals.el containing this
> >
> >       (...
> >        (ruby-mode . (...
> >                      (flymake-diagnostic-functions ruby-flymake-simple)
> >                      ...))
> >        ...)
> >
> >    Won't this suffice as a per-project (almost zero) configuration?
>
> That still leaves the question of a reasonable default. But if you ask
> me, removing the custom variable a making the "auto" behavior "always
> on" will also be good.
>

[-- Attachment #2: Type: text/html, Size: 3461 bytes --]

  reply	other threads:[~2018-06-18 14:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08 14:55 bug#31760: 26.1; ruby-mode enables flymake-rubocop by default if the rubocop executable exists Petko Bordjukov
2018-06-08 18:42 ` João Távora
2018-06-15 15:16   ` Dmitry Gutov
2018-06-15 17:54     ` Bozhidar Batsov
2018-06-16  9:07       ` Petko Bordjukov
2018-06-16  9:31         ` Bozhidar Batsov
2018-06-16  9:36           ` Bozhidar Batsov
2018-06-16 19:47             ` Petko Bordjukov
2018-06-16 19:55               ` Bozhidar Batsov
2018-06-16 15:32         ` João Távora
2018-06-16 19:54           ` Petko Bordjukov
2018-06-18 14:02           ` Dmitry Gutov
2018-06-18 14:09             ` Bozhidar Batsov [this message]
2018-12-25 15:36               ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAM9Zgm0_Lv_xDG__-13TENHsR+CbYuBUK8qAhZ-RAyQxsZh3Gw@mail.gmail.com \
    --to=bozhidar@batsov.com \
    --cc=31760@debbugs.gnu.org \
    --cc=bordjukov@gmail.com \
    --cc=dgutov@yandex.ru \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).