Skip to content

Commit 8cc9f00

Browse files
committed
Include parentheses around single arrow func param
1 parent a1ef7d2 commit 8cc9f00

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

Scripts/BlackProcess.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class BlackProcess {
3434

3535
process.onStdout(this.handleOutput.bind(this));
3636
process.onStderr(this.handleError.bind(this));
37-
process.onDidExit((status) => {
37+
process.onDidExit(status => {
3838
if (status === 0) {
3939
resolve(this.stdOutOutput);
4040
} else {

Scripts/Flake8Process.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ class Flake8Process {
5656
request.actions = [nova.localize("OK")];
5757
const promise = nova.notifications.add(request);
5858
promise.then(
59-
(reply) => {},
60-
(error) => {
59+
reply => { },
60+
error => {
6161
console.error(error);
62-
},
62+
}
6363
);
6464
}
6565
this._onCompleteCallback(this.violations);

Scripts/Formatter.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class Formatter {
1212
request.actions = [nova.localize("OK")];
1313
const promise = nova.notifications.add(request);
1414
promise.then(
15-
(reply) => {},
16-
(error) => {
15+
reply => { },
16+
error => {
1717
console.error(error);
18-
},
18+
}
1919
);
2020
}
2121

@@ -28,13 +28,13 @@ class Formatter {
2828
const content = editor.document.getTextInRange(textRange);
2929
return this.process
3030
.execute(content)
31-
.then((formattedContent) => {
31+
.then(formattedContent => {
3232
// If Black isn't installed, the existing code will be formatted as
3333
// a single space. If that's the case, we skip that step.
3434
const isChangedContent = formattedContent !== content;
3535
const isNonEmptyContent = formattedContent.trim() !== "";
3636
if (isChangedContent && isNonEmptyContent) {
37-
editor.edit((edit) => {
37+
editor.edit(edit => {
3838
edit.replace(textRange, formattedContent);
3939
});
4040
}

Scripts/Linter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ class Linter {
77
}
88

99
async lintDocument(document) {
10-
this.process.onComplete((violations) => {
10+
this.process.onComplete(violations => {
1111
this.issues.set(
1212
document.uri,
13-
violations.map((violation) => violation.issue),
13+
violations.map(violation => violation.issue)
1414
);
1515
});
1616
this.process.execute(document.path);

Scripts/main.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
const Linter = require("./Linter");
22
const Formatter = require("./Formatter");
33

4-
exports.activate = function () {
4+
exports.activate = function() {
55
const linter = new Linter();
66
const formatter = new Formatter();
77

8-
nova.workspace.onDidAddTextEditor((editor) => {
8+
nova.workspace.onDidAddTextEditor(editor => {
99
const document = editor.document;
1010

1111
if (document.syntax !== "python") {
@@ -14,17 +14,17 @@ exports.activate = function () {
1414

1515
linter.lintDocument(document);
1616

17-
editor.onDidSave((editor) => linter.lintDocument(document));
18-
document.onDidChangeSyntax((document) => linter.lintDocument(document));
19-
editor.onWillSave((editor) => {
17+
editor.onDidSave(editor => linter.lintDocument(document));
18+
document.onDidChangeSyntax(document => linter.lintDocument(document));
19+
editor.onWillSave(editor => {
2020
const formatOnSave = nova.workspace.config.get("is.flother.Blake.formatOnSave");
2121
if (formatOnSave) {
2222
return formatter.format(editor);
2323
}
2424
});
2525

26-
editor.onDidDestroy((destroyedEditor) => {
27-
const anotherEditor = nova.workspace.textEditors.find((editor) => {
26+
editor.onDidDestroy(destroyedEditor => {
27+
const anotherEditor = nova.workspace.textEditors.find(editor => {
2828
return editor.document.path === destroyedEditor.document.path;
2929
});
3030
if (!anotherEditor) {
@@ -33,5 +33,5 @@ exports.activate = function () {
3333
});
3434
});
3535

36-
nova.commands.register("formatSourceCodeWithBlack", (editor) => formatter.format(editor));
36+
nova.commands.register("formatSourceCodeWithBlack", editor => formatter.format(editor));
3737
};

0 commit comments

Comments
 (0)