/*
Lints the directory passed in as a command line argument
161216
function lintDirectory () {
  var shouldFix = args.hasOwnProperty('fix');

  cli = new eslint.CLIEngine({ configFile: configFilePath, fix: shouldFix });

  report = cli.executeOnFiles(dir);

  if (shouldFix) {
    eslint.CLIEngine.outputFixes(report);
  }

  console.log(cli.getFormatter()(report.results)); // eslint-disable-line

  // End with exit code 1 if there are errors
  // Use process.exit instead of throwing to mimic the behaviour of eslints bin
  // We don't want a stacktrace, it would just be confusing
  if (report.errorCount) {
      process.exit(1); // eslint-disable-line
  }
}
380670
function createDir(pathArg) {
  const { dir, ext } = path.parse(pathArg);
  const dirNames = (ext === '')
    ? pathArg.split(path.sep)
    : dir.split(pathArg.sep);

  dirNames.reduce((accumDir, currentdir) => {
    const jointDir = path.join(accumDir, currentdir);
    if (!fs.existsSync(jointDir)) {
      fs.mkdirSync(jointDir);
    }
    return jointDir;
  }, '');
}
1035221
function lintJS(src, dest) {
  dest = dest || config.src.jsPath;

  return gulp.src(src)
    .pipe(eslint({
      fix: true
    }))
    .pipe(eslint.format())
    .pipe(isFixed(dest));
}
717462
function lint (options) {
  if (!options.language) {
    throw new Error('options.language missing')
  }

  if (!Array.isArray(options.arguments)) {
    throw new TypeError('options.arguments has to be an array')
  }

  process.env.NODE_ENV = 'development'

  if (options.language === 'css') {
    process.env.PANGOLIN_ENV = 'lint:css'

    lintCSS(options.arguments)
      ? process.exit(0)
      : process.exit(1)
  }

  if (options.language === 'js') {
    process.env.PANGOLIN_ENV = 'lint:js'

    lintJS(options.arguments)
      ? process.exit(0)
      : process.exit(1)
  }
}
187636
function lint () {
  console.log(
    chalk.gray('Running linting…\n')
  )

  // Run all linters
  const results = [
    dockerLinter,
    templateLinter,
    javascriptLinter,
    markdownLinter,
    sassLinter
  ]
    .map((Linter) => {
      const linter = new Linter()
      return linter.lint()
    })

  console.log(
    chalk.gray('\nlinting complete!')
  )

  const erred = results.indexOf(true) !== -1

  // If file was called via CLI and there are errors exit process with failed status
  if (require.main === module && erred) {
    process.exit(1)
  }

  return erred
}
1083953
def lint():
    ""
    # report according to file extension
    report_formats = {
        ".html": "html",
        ".log": "parseable",
        ".txt": "text",
    }

    lint_build_dir = easy.path("build/lint")
    lint_build_dir.exists() or lint_build_dir.makedirs()  # pylint: disable=expression-not-assigned

    argv = []
    rcfile = easy.options.lint.get("rcfile")
    if not rcfile and easy.path("pylint.cfg").exists():
        rcfile = "pylint.cfg"
    if rcfile:
        argv += ["--rcfile", os.path.abspath(rcfile)]
    if easy.options.lint.get("msg_only", False):
        argv += ["-rn"]
    argv += [
        "--import-graph", (lint_build_dir / "imports.dot").abspath(),
    ]
    argv += support.toplevel_packages()

    sys.stderr.write("Running %s::pylint '%s'\n" % (sys.argv[0], "' '".join(argv)))
    outfile = easy.options.lint.get("output", None)
    if outfile:
        outfile = os.path.abspath(outfile)

    try:
        with easy.pushd("src" if easy.path("src").exists() else "."):
            if outfile:
                argv.extend(["-f", report_formats.get(easy.path(outfile).ext, "text")])
                sys.stderr.write("Writing output to %r\n" % (str(outfile),))
                outhandle = open(outfile, "w")
                try:
                    subprocess.check_call(["pylint"] + argv, stdout=outhandle)
                finally:
                    outhandle.close()
            else:
                subprocess.check_call(["pylint"] + argv, )
            sys.stderr.write("paver::lint - No problems found.\n")
    except subprocess.CalledProcessError as exc:
        if exc.returncode & 32:
            # usage error (internal error in this code)
            sys.stderr.write("paver::lint - Usage error, bad arguments %r?!\n" % (argv,))
            sys.exit(exc.returncode)
        else:
            bits = {
                1: "fatal",
                2: "error",
                4: "warning",
                8: "refactor",
                16: "convention",
            }
            sys.stderr.write("paver::lint - Some %s message(s) issued.\n" % (
                ", ".join([text for bit, text in bits.items() if exc.returncode & bit])
            ))
            if exc.returncode & 3:
                sys.stderr.write("paver::lint - Exiting due to fatal / error message.\n")
                sys.exit(exc.returncode)
1171377
def lint(files, inline_mode = false, options = {})
      final_options = options.merge(json: true)

      issues = files
               .map { |file| Shellwords.escape(file) }
               .map { |file| `hlint lint #{file} #{to_hlint_options(final_options)} 2>/dev/null` }
               .reject { |s| s == '' }
               .map { |lint_result| JSON.parse(lint_result).flatten }
               .flatten

      self.suggestions = issues.select { |issue| issue['severity'] == 'Suggestion' }
      self.warnings = issues.select { |issue| issue['severity'] == 'Warning' }
      self.errors = issues.select { |issue| issue['severity'] == 'Error' }

      if inline_mode
        # Reprt with inline comment
        send_inline_comment(suggestions, 'warn')
        send_inline_comment(warnings, 'warn')
        send_inline_comment(errors, 'fail')

      else
        # Report if any suggestions, warnings or errors
        if suggestions.count > 0 || warnings.count > 0 || errors.count > 0
          message = "### hlint found issues\n\n"
          message << markdown_issues(warnings, 'Suggestions') unless suggestions.empty?
          message << markdown_issues(warnings, 'Warnings') unless warnings.empty?
          message << markdown_issues(errors, 'Errors') unless errors.empty?
          markdown message
        end
      end
    end
530668
function nodeExec(args) {
	args = arguments; // make linting happy
	var code = nodeCLI.exec.apply(nodeCLI, args).code;
	if (code !== 0) {
		exit(code);
	}
}
663155
def _get_files_to_lint(self, external_directories):
        """"""
        all_f = []

        for external_dir in external_directories:
            all_f.extend(_all_files_matching_ext(external_dir, "py"))

        packages = self.distribution.packages or list()
        for package in packages:
            all_f.extend(_all_files_matching_ext(package, "py"))

        py_modules = self.distribution.py_modules or list()
        for filename in py_modules:
            all_f.append(os.path.realpath(filename + ".py"))

        all_f.append(os.path.join(os.getcwd(), "setup.py"))

        # Remove duplicates which may exist due to symlinks or repeated
        # packages found by /setup.py
        all_f = list(set([os.path.realpath(f) for f in all_f]))

        exclusions = [
            "*.egg/*",
            "*.eggs/*"
        ] + self.exclusions
        return sorted([f for f in all_f if not _is_excluded(f, exclusions)])
321226
function splitDirs(dirString)
{
	var dirs,i,len;
	var output = [];
	
	// Speed optimization
	if (dirString !== "/")
	{
		dirs = dirString.split("/");
		len = dirs.length;
		
		for (i=0; i<len; i++)
		{
			// Cleanup -- splitting "/dir/" becomes ["","dir",""]
			if (dirs[i] !== "")
			{
				output.push( dirs[i] );
			}
		}
	}
	
	return output;
}
13478
def lint():
    """"""
    py_files = subprocess.check_output("git ls-files")
    if PY3:
        py_files = py_files.decode()
    py_files = [x for x in py_files.split() if x.endswith('.py')]
    py_files = ' '.join(py_files)
    sh("%s -m flake8 %s" % (PYTHON, py_files), nolog=True)
1266285
function _mkdirpSync (directory, mode) {

			if ("undefined" === typeof directory) {
				throw new ReferenceError("missing \"directory\" argument");
			}
				else if ("string" !== typeof directory) {
					throw new TypeError("\"directory\" argument is not a string");
				}
				else if ("" === directory.trim()) {
					throw new Error("\"directory\" argument is empty");
				}
			else if ("undefined" !== typeof mode && "number" !== typeof mode) {
				throw new TypeError("\"mode\" argument is not a number");
			}
			else if (!isDirectorySync(directory)) {

				const SUB_DIRECTORY = dirname(directory);

				if (!isDirectorySync(SUB_DIRECTORY)) {
					_mkdirpSync(SUB_DIRECTORY);
				}

				mkdirSync(directory, mode ? mode : DEFAULT_OPTION);

			}

		}
707073
def lint():
    
    path = os.path.realpath(os.getcwd())
    cmd = 'flake8 %s' % path
    opt = ''
    print(">>> Linting codebase with the following command: %s %s" % (cmd, opt))

    try:
        return_code = call([cmd, opt], shell=True)
        if return_code < 0:
            print(">>> Terminated by signal", -return_code, file=sys.stderr)
        elif return_code != 0:
            sys.exit('>>> Lint checks failed')
        else:
            print(">>> Lint checks passed", return_code, file=sys.stderr)
    except OSError as e:
        print(">>> Execution failed:", e, file=sys.stderr)
331452
function execLinter(bin, args, execaOptions, pathsToLint) {
  const binArgs = args.concat(pathsToLint)

  debug('bin:', bin)
  debug('args: %O', binArgs)
  debug('opts: %o', execaOptions)

  return execa(bin, binArgs, { ...execaOptions })
}
400946
function (args, callback) {
        var query =
          {
            type: "lint",  //$NON-NLS-1$
            file: args.meta.location,
            config: args.config
          };
        ternserver.request(
          {
            query: query,
            files: args.files
          },
          function (error, problems) {
            if (error) {
              callback({request: 'lint', error: error.message, message: Messages['failedToComputeProblems']}); //$NON-NLS-1$
            } else if (problems && Array.isArray(problems)) {
              callback({request: 'lint', problems: problems}); //$NON-NLS-1$
            } else {
              callback({request: 'lint', problems: []}); //$NON-NLS-1$
            }
          });
      }
322701
private function lintDir($dir)
    {
        $finder = Finder::create();
        $finder->files()
            ->in($dir);

        $patterns = $this->input->getOption(self::OPTION_PATTERN);
        if (!empty($patterns)) {
            $patterns = explode(',', $patterns);
            foreach ($patterns as $pattern) {
                $finder->name(trim($pattern));
            }
        } else {
            $finder->name('*.xml.dist')
                ->name('*.xml');
        }

        if (!$this->input->getOption(self::OPTION_RECURSIVE)) {
            $finder->depth(0);
        }

        if ($this->input->hasOption(self::OPTION_EXCLUDE)) {
            $exclude = explode(',', $this->input->getOption(self::OPTION_EXCLUDE));
            $finder->exclude($exclude);
        }

        $totalFiles = $finder->count();

        $counter = 0;
        $ret = true;
        /** @var SplFileInfo $file */
        foreach ($finder as $file) {
            $ret = $this->lintFile($file) && $ret;
            if (0 == ++$counter % 30) {
                $this->output->writeln(sprintf(
                    ' %8d/%d %6.2f%%',
                    $counter,
                    $totalFiles,
                    $counter / $totalFiles * 100
                ));
            }
        }

        return $ret;
    }
994464
@SuppressWarnings("static-access")
	public static void main(String[] args) throws IOException {		
		Option configDirOpt = OptionBuilder.withArgName("config directory").hasArg().withDescription(
			"Specify configuration directory.").create("configDir");
		// tempDir option is used by the YARN client.
		Option tempDir = OptionBuilder.withArgName("temporary directory (overwrites configured option)")
				.hasArg().withDescription(
				"Specify temporary directory.").create(ARG_CONF_DIR);
		configDirOpt.setRequired(true);
		tempDir.setRequired(false);
		Options options = new Options();
		options.addOption(configDirOpt);
		options.addOption(tempDir);
		

		CommandLineParser parser = new GnuParser();
		CommandLine line = null;
		try {
			line = parser.parse(options, args);
		} catch (ParseException e) {
			System.err.println("CLI Parsing failed. Reason: " + e.getMessage());
			System.exit(FAILURE_RETURN_CODE);
		}

		String configDir = line.getOptionValue(configDirOpt.getOpt(), null);
		String tempDirVal = line.getOptionValue(tempDir.getOpt(), null);

		// First, try to load global configuration
		GlobalConfiguration.loadConfiguration(configDir);
		if(tempDirVal != null // the YARN TM runner has set a value for the temp dir
				// the configuration does not contain a temp direcory
				&& GlobalConfiguration.getString(ConfigConstants.TASK_MANAGER_TMP_DIR_KEY, null) == null) {
			Configuration c = GlobalConfiguration.getConfiguration();
			c.setString(ConfigConstants.TASK_MANAGER_TMP_DIR_KEY, tempDirVal);
			LOG.info("Setting temporary directory to "+tempDirVal);
			GlobalConfiguration.includeConfiguration(c);
		}
		System.err.println("Configuration "+GlobalConfiguration.getConfiguration());
		LOG.info("Current user "+UserGroupInformation.getCurrentUser().getShortUserName());
		
		{
			// log the available JVM memory
			long maxMemoryMiBytes = Runtime.getRuntime().maxMemory() >>> 20;
			LOG.info("Starting TaskManager in a JVM with " + maxMemoryMiBytes + " MiBytes maximum heap size.");
		}
		
		// Create a new task manager object
		try {
			new TaskManager();
		} catch (Exception e) {
			LOG.fatal("Taskmanager startup failed: " + e.getMessage(), e);
			System.exit(FAILURE_RETURN_CODE);
		}
		
		// park the main thread to keep the JVM alive (all other threads may be daemon threads)
		Object mon = new Object();
		synchronized (mon) {
			try {
				mon.wait();
			} catch (InterruptedException ex) {}
		}
	}