nl_tokens: Function that calls Solium object s linter based on user settings . If not given we lint the entire directory s ( and sub - directories ) solidity files .
pl_tokens: function lint ( userConfig , input , ignore , errorReporter ) { let filesToLint , errorCount ; //If filename is provided, lint it. Otherwise, lint over current directory & sub-directories if ( input . file ) { if ( ! fsUtils . isFile ( input . file ) ) { errorReporter . reportFatal ( ` ${ input . file } ` ) ; process . exit ( errorCodes . INVALID_PARAMS ) ; } filesToLint = [ input . file ] ; } else if ( input . dir ) { if ( ! fsUtils . isDirectory ( input . dir ) ) { errorReporter . reportFatal ( ` ${ input . dir } ` ) ; process . exit ( errorCodes . INVALID_PARAMS ) ; } filesToLint = traverse ( input . dir , <mask> ) ; } if ( filesToLint ) { errorCount = sum ( filesToLint . map ( function ( file , index ) { userConfig . options . returnInternalIssues = ( index === 0 ) ; return lintFile ( file , userConfig , errorReporter ) ; } ) ) ; } else if ( input . stdin ) { // This only works on *nix. Need to fix to enable stdin input in windows. let sourceCode = fs . readFileSync ( "/dev/stdin" , "utf-8" ) ; userConfig . options . returnInternalIssues = true ; errorCount = lintString ( sourceCode , userConfig , errorReporter , "[stdin]" ) ; } else { errorReporter . reportFatal ( "Must specify input for linter using --file, --dir or --stdin" ) ; process . exit ( errorCodes . INVALID_PARAMS ) ; } errorReporter . finalize && errorReporter . finalize ( ) ; return errorCount ; }