Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: Replace var with let #72

Merged
merged 1 commit into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bin/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ function load(sha, cb) {
}

function loadPatch(uri, cb) {
var h = http
let h = http
if (~uri.protocol.indexOf('https')) {
h = https
}
uri.headers = {
'user-agent': 'core-validate-commit'
}
h.get(uri, (res) => {
var buf = ''
let buf = ''
res.on('data', (chunk) => {
buf += chunk
})
Expand Down Expand Up @@ -109,8 +109,8 @@ if (parsed.tap) {
const tap = new Tap()
tap.pipe(process.stdout)
if (parsed.out) tap.pipe(fs.createWriteStream(parsed.out))
var count = 0
var total = args.length
let count = 0
let total = args.length

v.on('commit', (c) => {
count++
Expand Down
2 changes: 1 addition & 1 deletion lib/format-pretty.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function formatLength(msg, opts) {
const str = msg.string
const l = str.length
if (!opts.detailed) return out
var col = msg.column || 0
const col = msg.column || 0
const diff = str.slice(0, col) + chalk.red(str.slice(col, l))
return `${out}
${diff}`
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/fixes-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module.exports = {
}

function findLineAndColumn(body, str) {
for (var i = 0; i < body.length; i++) {
for (let i = 0; i < body.length; i++) {
const l = body[i]
if (~l.indexOf('Fixes')) {
const idx = l.indexOf(str)
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/line-length.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
})
return
}
var failed = false
let failed = false
for (let i = 0; i < parsed.body.length; i++) {
const line = parsed.body[i]
// Skip quoted lines, e.g. for original commit messages of V8 backports.
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/metadata-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
if (end < body.length) {
const extra = body.slice(end + 1)
let lineNum = end + 1
for (var i = 0; i < extra.length; i++) {
for (let i = 0; i < extra.length; i++) {
if (extra[i]) {
lineNum += i
break
Expand Down
6 changes: 3 additions & 3 deletions lib/rules/pr-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ module.exports = {
})
return
}
var line = -1
var column = -1
for (var i = 0; i < context.body.length; i++) {
let line = -1
let column = -1
for (let i = 0; i < context.body.length; i++) {
const l = context.body[i]
if (~l.indexOf('PR-URL') && ~l.indexOf(context.prUrl)) {
line = i
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/subsystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module.exports = {
})
}
} else {
var failed = false
let failed = false
for (const sub of parsed.subsystems) {
if (!~subs.indexOf(sub)) {
failed = true
Expand Down