mirror of
https://github.com/jimeh/rubocopfmt.el.git
synced 2026-02-19 09:06:41 +00:00
feat(cops): Add support for running unsafe cops with latest RuboCop
Latest version of RuboCop now only performs auto-corrections from "safe" cops when given the `--auto-correct`/`-a` option. To run auto-corrections from all cops, including "unsafe" ones, you must now pass in `--auto-correct-all`/`-A` instead. The new `rubocopfmt-include-unsafe-cops` defcustom defaults to no `nil`, for backwards compatibility. Turn on unsafe cops by setting it to `t`.
This commit is contained in:
13
README.md
13
README.md
@@ -45,6 +45,19 @@ Place `rubocopfmt.el` somewhere into you `load-path` and require it. For example
|
||||
With `rubocopfmt-mode` enabled, Ruby buffer will automatically be formatted with
|
||||
RuboCop on save.
|
||||
|
||||
### Unsafe Cops
|
||||
|
||||
RuboCop no longer runs auto-corrections for unsafe cops. To enable unsafe cops,
|
||||
set `rubocopfmt-include-unsafe-cops` to `t`. If you're using use-package:
|
||||
|
||||
```elisp
|
||||
(use-package rubocopfmt
|
||||
:hook
|
||||
(ruby-mode . rubocopfmt-mode)
|
||||
:custom
|
||||
(rubocopfmt-include-unsafe-cops t))
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
- `rubocopfmt` - Format current buffer with RuboCop.
|
||||
|
||||
Reference in New Issue
Block a user