Comparing version 1.0.7 to 1.0.8
@@ -31,12 +31,4 @@ | ||
return !this.isUpperSnakeCase(text); | ||
}, | ||
isSnakeCase (text) { | ||
return match(text, /[a-z0-9]+[_a-z0-9]*/); | ||
}, | ||
isNotSnakeCase (text) { | ||
return !this.isSnakeCase(text); | ||
} | ||
}; |
@@ -47,36 +47,2 @@ | ||
findDownAllTypes(ctx, type) { | ||
if (ctx && ctx.constructor.name === type) { | ||
return [ctx]; | ||
} else if (ctx && ctx.children) { | ||
let items = ctx | ||
.children | ||
.reduce(i => this.findDownAllTypes(i, type)); | ||
return items.length > 0 && items[0] || null; | ||
} else { | ||
return []; | ||
} | ||
} | ||
findDown(ctx, nesting, itemIndex) { | ||
for (let i = 0; i < nesting - 1; i += 1) { | ||
ctx = ctx.getChild(0); | ||
if (!ctx) { | ||
return null; | ||
} | ||
} | ||
if (nesting > 0) { | ||
ctx = ctx.getChild(itemIndex); | ||
if (!ctx) { | ||
return null; | ||
} | ||
} | ||
return ctx; | ||
} | ||
*findIdentifier(ctx) { | ||
@@ -83,0 +49,0 @@ const children = ctx.children; |
@@ -40,3 +40,3 @@ const Reporter = require('./../reporter'); | ||
ctx.getSourceInterval(), SEVERITY.ERROR, | ||
`Expression indentation is incorrect.${message && ' ' + message || ''}`, | ||
`Expression indentation is incorrect. ${message}`, | ||
'expression-indent' | ||
@@ -43,0 +43,0 @@ ); |
@@ -273,8 +273,9 @@ const Reporter = require('./../reporter'); | ||
validate (linesWithError, ctx) { | ||
const tokens = ctx.parser._input.tokens.filter(i => i.channel === 0); | ||
const tokens = ctx.parser._input.tokens.filter(i => i.channel === 0 && i.type >= 0); | ||
tokens.forEach(this.applyTokenIndent.bind(this)); | ||
for (let curLine in this.firstIndent) { | ||
if (linesWithError.includes(curLine)) { | ||
for (let curLineStr in this.firstIndent) { | ||
const curLine = Number(curLineStr); | ||
if (linesWithError.includes(Number(curLine))) { | ||
continue; | ||
@@ -284,5 +285,4 @@ } | ||
const curIndent = this.firstIndent[curLine]; | ||
if (this.isNotValidForBaseIndent(curIndent)) { | ||
this.makeReport(curLine + 1, curIndent); | ||
this.makeReport(curLine, curIndent); | ||
} | ||
@@ -297,3 +297,3 @@ } | ||
if (curIndent > column) { | ||
if (curIndent > column || _.isUndefined(curIndent)) { | ||
this.firstIndent[line] = column; | ||
@@ -300,0 +300,0 @@ } |
@@ -24,6 +24,2 @@ const Reporter = require('./../reporter'); | ||
exitAssemblyItem(ctx) { | ||
this.validateQuotes(ctx); | ||
} | ||
exitDataSize(ctx) { | ||
@@ -56,8 +52,3 @@ ctx.children && this.validateQuotes(ctx.children[2]); | ||
this.makeReport(ctx); | ||
return; | ||
} | ||
if (ctx.getText().endsWith(this.incorrectQuote)) { | ||
this.makeReport(ctx); | ||
} | ||
} | ||
@@ -64,0 +55,0 @@ |
@@ -119,3 +119,3 @@ const Reporter = require('./../reporter'); | ||
ctx.getSourceInterval(), SEVERITY.ERROR, | ||
`Statement indentation is incorrect.${message && ' ' + message || ''}`, | ||
`Statement indentation is incorrect. ${message}`, | ||
'statement-indent' | ||
@@ -122,0 +122,0 @@ ); |
{ | ||
"name": "solhint", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Solidity Code Linter", | ||
@@ -5,0 +5,0 @@ "main": "solhint.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1320351
18421