Comparing version 0.1.1 to 0.1.2
{ | ||
"rules": { | ||
"imports-on-top": { | ||
"enabled": true, | ||
"recommended": true, | ||
"type": "error", | ||
"description": "Ensure that all import statements are on top of the file" | ||
}, | ||
"variable-declarations": { | ||
"enabled": true, | ||
"recommended": true, | ||
"type": "error", | ||
"description": "Ensure that array declarations don't have space between the type and brackets" | ||
}, | ||
"lbrace": { | ||
@@ -5,0 +19,0 @@ "enabled": true, |
@@ -95,2 +95,3 @@ /** | ||
.option ('-f, --file [filename]', 'Specify a file whose code you wish to lint') | ||
.option ('-h, --hot', 'Enable Hot Loading (Hot Swapping)') | ||
.parse (programArgs); | ||
@@ -124,3 +125,18 @@ | ||
cli.file ? lint (userConfig, cli.file) : lint (userConfig); | ||
if (cli.file) { | ||
lint (userConfig, cli.file); | ||
} else if (cli.hot) { | ||
var spy = fs.watch (CWD); | ||
lint (userConfig); //initial lint | ||
spy.on ('change', function () { | ||
lint (userConfig); //lint on subsequent changes (hot) | ||
console.log (Array (50).join ('X') + '\n'); | ||
}); | ||
} else { | ||
lint (userConfig); | ||
} | ||
} | ||
@@ -127,0 +143,0 @@ |
@@ -13,3 +13,2 @@ /** | ||
var camelCaseRegEx = /^[A-Z][a-z]+[a-zA-Z]*[a-z]$/; | ||
var eventsToWatch = [ | ||
@@ -16,0 +15,0 @@ 'ContractStatement', |
@@ -35,2 +35,11 @@ /** | ||
/** | ||
* Get the parent node of the specified node | ||
* @param {Object} node The AST Node to retrieve the parent of | ||
* @returns {Integer} parent Parent node of the given node | ||
*/ | ||
exports.getParent = function (node) { | ||
return node.parent; | ||
} | ||
/** | ||
* Retrieve the line number on which the code for provided node exists inside the source code | ||
@@ -37,0 +46,0 @@ * @param {Object} node The AST Node to retrieve the line number of |
@@ -9,2 +9,7 @@ /** | ||
var astUtils = require ('./ast-utils'); | ||
var INHERITABLE_METHODS = [ | ||
'getLine', | ||
'getColumn', | ||
'getParent' | ||
]; | ||
@@ -31,3 +36,3 @@ /** | ||
getText: function (node, beforeCount, afterCount) { | ||
var sourceCodeText = this.text; console.log (node); | ||
var sourceCodeText = this.text; | ||
@@ -52,2 +57,7 @@ if (node) { | ||
INHERITABLE_METHODS.forEach (function (methodName) { | ||
SourceCode.prototype [methodName] = astUtils [methodName]; | ||
}); | ||
module.exports = SourceCode; |
{ | ||
"name": "solium", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A flexible, stand-alone linter for Ethereum Solidity", | ||
@@ -5,0 +5,0 @@ "main": "./lib/solium.js", |
@@ -6,2 +6,4 @@ # Solium | ||
Solium aims to comply with the official [Solidity Style Guide](http://solidity.readthedocs.io/en/latest/style-guide.html). In future, Solium would allow its users to choose between certain rules (for example - tabs vs. spaces). | ||
#Install | ||
@@ -32,2 +34,8 @@ ```bash | ||
This lints all the files inside your project with ```.sol``` extension. | ||
#Additional Options | ||
1. use ```solium --hot``` to enable Hot loading (Hot swapping). This currently works only over the full project. | ||
#Plugging in your custom rules | ||
@@ -34,0 +42,0 @@ -> Open up the ```.soliumrc.json``` configuration file and set the value of ```custom-rules-filename``` to the path of the file that defines your rules. You can either provide an absolute path or a path relative to the directory in which .soliumrc.json resides. For example: ```"custom-rules-filename": "./my-rules.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
33357
25
902
115