Socket
Socket
Sign inDemoInstall

solhint

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solhint - npm Package Compare versions

Comparing version 1.0.13 to 1.0.14

.nyc_output/6e070cd60c227c23f89998fc4cf90f98.json

32

lib/common/statements-indent-validator.js

@@ -0,1 +1,2 @@

const _ = require('lodash');

@@ -14,7 +15,16 @@

forEachError(callback) {
this.casesList.forEach(curCase =>
curCase.forEachError(this.ctx, callback)
);
errorsTo(callback) {
const validCase = this._validCase();
validCase && validCase.validate(once(callback));
}
_validCase() {
for (let curCase of this.casesList) {
if (curCase.syntaxMatch(this.ctx)) {
return curCase;
}
}
return null;
}
}

@@ -80,9 +90,9 @@

forEachError(ctx, callback) {
if (this._syntaxMatch(ctx)) {
this._validate(once(callback));
errorsTo(ctx, callback) {
if (this.syntaxMatch(ctx)) {
this.validate(once(callback));
}
}
_syntaxMatch(ctx) {
syntaxMatch(ctx) {
const childs = ctx.children;

@@ -104,3 +114,3 @@ const syntaxMatchers = this.items.filter(i => i.syntaxMatch);

_validate(callback) {
validate(callback) {
return this

@@ -242,3 +252,3 @@ .items

const tokenList = tokens(ctx);
const tokenIndex = tokenList.indexOf(token);
const tokenIndex = _.sortedIndexBy(tokenList, token, token => token.start);

@@ -257,3 +267,3 @@ let prevTokenIndex = tokenIndex - 1;

const tokenList = tokens(ctx);
const tokenIndex = tokenList.indexOf(token);
const tokenIndex = _.sortedIndexBy(tokenList, token, token => token.start);

@@ -260,0 +270,0 @@ let nextTokenIndex = tokenIndex + 1;

@@ -32,3 +32,3 @@ const Reporter = require('./../reporter');

)
.forEachError(
.errorsTo(
this.makeReport.bind(this)

@@ -35,0 +35,0 @@ );

@@ -112,5 +112,7 @@ const Reporter = require('./../reporter');

this.ctx = ctx;
this.startBracketIndex = _.memoize(this._startBracketIndex.bind(this));
this.endBracketIndex = _.memoize(this._endBracketIndex.bind(this));
}
startBracketIndex () {
_startBracketIndex () {
const children = this.ctx.children;

@@ -132,3 +134,3 @@ return children && children.map(i => i.getText()).indexOf('{');

endBracketIndex () {
_endBracketIndex () {
return this.ctx.children.map(i => i.getText()).indexOf('}');

@@ -135,0 +137,0 @@ }

@@ -22,3 +22,3 @@ const Reporter = require('./../reporter');

)
.forEachError(
.errorsTo(
this.makeReport.bind(this)

@@ -33,3 +33,3 @@ );

.term('while').space().term('(').noSpaces().expression().noSpaces().term(')').statement()
.forEachError(ctx, this.makeReport.bind(this));
.errorsTo(ctx, this.makeReport.bind(this));
}

@@ -41,3 +41,3 @@

.term('while').space().term('(').noSpaces().expression().noSpaces().term(')').noSpaces().term(';')
.forEachError(ctx, this.makeReport.bind(this));
.errorsTo(ctx, this.makeReport.bind(this));

@@ -52,2 +52,6 @@ this.validateBracketsForDoWhileStatement(ctx);

.cases(
term('for').space().term('(')
.noSpaces().rule('simpleStatement').space().expression().noSpaces().term(';')
.space().expression().noSpaces().term(')').statement(),
term('for').space().term('(').noSpaces().term(';').noSpaces().term(';').noSpaces().term(')')

@@ -78,9 +82,5 @@ .statement(),

.noSpaces().rule('simpleStatement').noSpaces().term(';').space().expression()
.noSpaces().term(')').statement(),
term('for').space().term('(')
.noSpaces().rule('simpleStatement').space().expression().noSpaces().term(';')
.space().expression().noSpaces().term(')').statement()
.noSpaces().term(')').statement()
)
.forEachError(this.makeReport.bind(this));
.errorsTo(this.makeReport.bind(this));
}

@@ -87,0 +87,0 @@

{
"name": "solhint",
"version": "1.0.13",
"version": "1.0.14",
"description": "Solidity Code Linter",

@@ -37,3 +37,2 @@ "main": "solhint.js",

"assert": "1.4.1",
"browserify": "^14.4.0",
"coveralls": "2.13.1",

@@ -40,0 +39,0 @@ "mocha": "3.5.0",

@@ -1,2 +0,2 @@

#!/usr/bin/env node
//#!/usr/bin/env node

@@ -12,3 +12,3 @@ const program = require('commander');

program
.version('1.0.0');
.version('1.0.14');

@@ -15,0 +15,0 @@ program

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc