Skip to content

Commit

Permalink
Added a listener to also run RuboCop before save.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmecham committed Mar 28, 2020
1 parent 4939ff3 commit 6d235c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions RuboCop.novaextension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## UNRELEASED

- Added a listener to also run RuboCop before save.
- Added better error handling when running the `rubocop` command so that we
don't completely blow up when there are configuration warnings and errors.

Expand Down
1 change: 1 addition & 0 deletions Source/Scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ exports.activate = function() {
nova.workspace.onDidAddTextEditor((editor) => {
linter.lintDocument(editor.document);

editor.onWillSave(editor => linter.lintDocument(editor.document));
editor.onDidStopChanging(editor => linter.lintDocument(editor.document));
editor.document.onDidChangeSyntax(document => linter.lintDocument(document));

Expand Down

0 comments on commit 6d235c6

Please sign in to comment.