jenkins-bot has submitted this change and it was merged.
Change subject: Add a proper .jshintrc and pass JSHint
......................................................................
Add a proper .jshintrc and pass JSHint
Change-Id: I5cd836169e11d279661d202aa105b2e0a15be24e
---
M .jshintrc
M src/colors.js
M src/preprocess.js
M src/relay.js
4 files changed, 31 insertions(+), 17 deletions(-)
Approvals:
Yuvipanda: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.jshintrc b/.jshintrc
index 0967ef4..79a66a1 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -1 +1,12 @@
-{}
+{
+ // Enforcing
+ "bitwise": true,
+ "eqeqeq": true,
+ "freeze": true,
+ "latedef": true,
+ "noarg": true,
+ "nonew": true,
+ "undef": true,
+ "unused": true,
+ "node": true
+}
diff --git a/src/colors.js b/src/colors.js
index 7d494f2..2dfc7c5 100644
--- a/src/colors.js
+++ b/src/colors.js
@@ -9,6 +9,6 @@
_fun = _fun[colors[i]];
}
- colorized = _fun(text);
+ var colorized = _fun(text);
return colorized;
};
diff --git a/src/preprocess.js b/src/preprocess.js
index 1cf6cf1..2fc0402 100644
--- a/src/preprocess.js
+++ b/src/preprocess.js
@@ -101,7 +101,7 @@
message.approvals.forEach(function(approval) {
if(approval.type === 'Verified') {
ret.approvals.V = approval.value;
- } else if (approval.type == 'Code-Review') {
+ } else if (approval.type === 'Code-Review') {
ret.approvals.C = approval.value;
}
});
diff --git a/src/relay.js b/src/relay.js
index cbbe76a..45a17c9 100644
--- a/src/relay.js
+++ b/src/relay.js
@@ -1,3 +1,5 @@
+/* jshint unused: vars */
+
var _ = require('underscore'),
irc = require('irc'),
swig = require('swig'),
@@ -104,20 +106,6 @@
});
ircClient.addListener('error', errorLog);
-var joinedChannels = [];
-function waitForChannelJoins(channel, nick, message) {
- logging.info(nick + " joined " + channel);
- if(nick === ircClient.nick) {
- joinedChannels.push(channel);
- logging.info("Joined channel " + channel);
- }
- if(joinedChannels.length === allChannels.length) {
- ircClient.removeListener('join', waitForChannelJoins);
- logging.info("Joined " + joinedChannels.length + " channels. Starting
relay");
- startRelay();
- }
-}
-ircClient.addListener('join', waitForChannelJoins);
function startRelay() {
subscribeToGerritStream(conns.gerrit.host, conns.gerrit.port,
conns.gerrit.username, conns.gerrit.keypath, function(err, message) {
@@ -143,3 +131,18 @@
}
});
}
+
+var joinedChannels = [];
+function waitForChannelJoins(channel, nick, message) {
+ logging.info(nick + " joined " + channel);
+ if(nick === ircClient.nick) {
+ joinedChannels.push(channel);
+ logging.info("Joined channel " + channel);
+ }
+ if(joinedChannels.length === allChannels.length) {
+ ircClient.removeListener('join', waitForChannelJoins);
+ logging.info("Joined " + joinedChannels.length + " channels. Starting
relay");
+ startRelay();
+ }
+}
+ircClient.addListener('join', waitForChannelJoins);
--
To view, visit https://gerrit.wikimedia.org/r/241904
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5cd836169e11d279661d202aa105b2e0a15be24e
Gerrit-PatchSet: 3
Gerrit-Project: labs/tools/grrrit
Gerrit-Branch: master
Gerrit-Owner: Polybuildr <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Polybuildr <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits