<commit_before>#!/usr/bin/env node

var fs = require( 'fs' );
var IndentChecker = require( '../lib/indent-checker' );

var args = process.argv.slice( 2 );
var files = args.filter( function( arg ) {
	return arg.substr( 0, 2 ) !== '--';
} );

if ( args[0] === '--version' ) {
	var version = require( '../package.json' ).version;
	console.log( 'mixedindentlint version ' + version );
	process.exit( 0 );
}

var messages = files.reduce( function( warnings, file ) {
	try {
		var input = fs.readFileSync( file, 'utf8' );
	} catch ( err ) {
		console.error( 'Error trying to read file "' + file + '":', err.message );
		process.exit( 1 );
	}
	var lines = IndentChecker.getLinesWithLessCommonType( input );<commit_msg>Print usage if no files are specified<commit_after>#!/usr/bin/env node

var fs = require( 'fs' );
var IndentChecker = require( '../lib/indent-checker' );

var args = process.argv.slice( 2 );
var files = args.filter( function( arg ) {
	return arg.substr( 0, 2 ) !== '--';
} );

if ( args[0] === '--version' ) {
	var version = require( '../package.json' ).version;
	console.log( 'mixedindentlint version ' + version );
	process.exit( 0 );
}

if ( files.length < 1 ) {
	console.log( 'No files to lint' );
	console.log( 'Usage: mixedindentlint <file1> [<file2>...]' );
	process.exit( 0 );
}

var messages = files.reduce( function( warnings, file ) {
	try {
		var input = fs.readFileSync( file, 'utf8' );
	} catch ( err ) {
		console.error( 'Error trying to read file "' + file + '":', err.message );
		process.exit( 1 );
	}
	var lines = IndentChecker.getLinesWithLessCommonType( input );
{'fraction_non_alphanumeric': 0.18569636135508155, 'fraction_numerical': 0.011292346298619825, 'mean_word_length': 3.5702005730659025, 'pattern_counts': {'":': 2, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1268555', 'n_tokens_mistral': 571, 'n_tokens_neox': 550, 'n_words': 151}