<commit_before>var chai = require( 'chai' );
var expect = chai.expect;

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

describe( "IndentChecker", function() {
	describe( ".getLineType()", function() {
		it( "returns 'spaces' when the input starts with spaces", function() {
			expect( IndentChecker.getLineType( "  foo" ) ).to.equal( 'spaces' );
		} );

		it( "returns 'tabs' when the input starts with tabs", function() {
			expect( IndentChecker.getLineType( "\tfoo" ) ).to.equal( 'tabs' );
		} );

		it( "returns 'none' when the input starts with no indentation", function() {
			expect( IndentChecker.getLineType( "foo" ) ).to.equal( 'none' );
		} );

		it( "returns 'none' when the input is empty", function() {
			expect( IndentChecker.getLineType( "\n" ) ).to.equal( 'none' );
		} );

		it( "returns 'none' when the input starts a comment block", function() {
			expect( IndentChecker.getLineType( "/**" ) ).to.equal( 'none' );
		} );

		it( "returns 'none' when the input ends a comment block", function() {
			expect( IndentChecker.getLineType( " */" ) ).to.equal( 'none' );
		} );
	} );

	describe( ".getLinesByType()", function() {
		it( "returns an object with keys for each type found", function() {
			var input = "  foobar1\n  foobar2\n\tfoobar3\n  foobar4";
			var types = IndentChecker.getLinesByType( input );
			expect( Object.keys( types ) ).to.have.length( 2 );
		} );

		it( "returns a list of lines for each type", function() {
			var input = "  foobar1\n  foobar2\n\n\tfoobar3\n  foobar4";
			var types = IndentChecker.getLinesByType( input );
			expect( types[ 'spaces' ] ).to.have.length( 3 );
			expect( types[ 'tabs' ] ).to.have.length( 1 );
		} );
	} );

	describe( ".getMostCommonIndentType()", function() {
		it( "returns 'spaces' when the input contains more space indentations than tabs", function() {
			var input = "  foobar1\n  foobar2\n\tfoobar3\n  foobar4\n";
			expect( IndentChecker.getMostCommonIndentType( input ) ).to.equal( 'spaces' );
		} );

		it( "returns 'tabs' when the input contains more tabs indentations than spaces", function() {
			var input = "\tfoobar1\n\tfoobar2\n  foobar3\n\tfoobar4\n";
			expect( IndentChecker.getMostCommonIndentType( input ) ).to.equal( 'tabs' );
		} );

		it( "returns 'none' when the input contains equal tab and space indentation", function() {
			var input = "\tfoobar1\n  foobar2\n\tfoobar3\n  foobar4\n";
			expect( IndentChecker.getMostCommonIndentType( input ) ).to.equal( 'none' );
		} );
	} );

	describe( ".getLinesWithLessCommonType()", function() {
		it( "returns an array of line numbers with the less-common indentation type from the input", function() {
			var input = "  foobar1\n  foobar2\n\tfoobar3\n  foobar4\n\tfoobar5";
			expect( IndentChecker.getLinesWithLessCommonType( input ) ).to.have.same.members( [ 3, 5 ] );
		} );

		it( "returns an empty array if the input is entirely one type", function() {
			var input = "  foobar1\n  foobar2\n  foobar3\n  foobar4\n";
			expect( IndentChecker.getLinesWithLessCommonType( input ) ).to.be.empty;
		} );

		it( "returns an empty array if the input indentation types are equal", function() {
			var input = "  foobar1\n  foobar2\n\tfoobar3\n\tfoobar4\n";
			expect( IndentChecker.getLinesWithLessCommonType( input ) ).to.be.empty;
		} );

		it( "ignores comment block indentations", function() {
			var input = "\tfoobar1\n/** foobar2\n * foobar3\n * foobar4\n */\n foobar6\n\tfoobar7";
			expect( IndentChecker.getLinesWithLessCommonType( input ) ).to.have.same.members( [ 6 ] );
		} );
	} );

	describe( ".lint()", function() {
		it( "returns an array of line numbers with the less-common indentation type from the input", function() {
			var input = "  foobar1\n  foobar2\n\tfoobar3\n  foobar4\n\tfoobar5";
			expect( IndentChecker.lint( input ) ).to.have.same.members( [ 3, 5 ] );
		} );

		it( "returns an array of line numbers without the specified indentation type from the input, if option is set", function() {
			var input = "  foobar1\n  foobar2\n\tfoobar3\n  foobar4\n\tfoobar5";
			expect( IndentChecker.lint( input, { indent: 'tabs' } ) ).to.have.same.members( [ 1, 2, 4 ] );
		} );

		it( "returns an array of line numbers including comments", function() {
			var input = "\tfoobar1\n  /** foobar2\n  * foobar3\n  * foobar4\n  */\n foobar6\n  // foobar7\n\tfoobar8";
			expect( IndentChecker.lint( input ) ).to.have.same.members( [ 1, 8 ] );
		} );

		it( "returns an array of line numbers ignoring comments, if option is set", function() {
			var input = "\tfoobar1\n  /** foobar2\n  * foobar3\n  * foobar4\n  */\n foobar6\n  // foobar7\n\tfoobar8";<commit_msg>Fix styles of test for eslint<commit_after>var chai = require( 'chai' );
var expect = chai.expect;

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

describe( 'IndentChecker', function() {
	describe( '.getLineType()', function() {
		it( 'returns "spaces" when the input starts with spaces', function() {
			expect( IndentChecker.getLineType( '  foo' ) ).to.equal( 'spaces' );
		} );

		it( 'returns "tabs" when the input starts with tabs', function() {
			expect( IndentChecker.getLineType( '\tfoo' ) ).to.equal( 'tabs' );
		} );

		it( 'returns "none" when the input starts with no indentation', function() {
			expect( IndentChecker.getLineType( 'foo' ) ).to.equal( 'none' );
		} );

		it( 'returns "none" when the input is empty', function() {
			expect( IndentChecker.getLineType( '\n' ) ).to.equal( 'none' );
		} );

		it( 'returns "none" when the input starts a comment block', function() {
			expect( IndentChecker.getLineType( '/**' ) ).to.equal( 'none' );
		} );

		it( 'returns "none" when the input ends a comment block', function() {
			expect( IndentChecker.getLineType( ' */' ) ).to.equal( 'none' );
		} );
	} );

	describe( '.getLinesByType()', function() {
		it( 'returns an object with keys for each type found', function() {
			var input = '  foobar1\n  foobar2\n\tfoobar3\n  foobar4';
			var types = IndentChecker.getLinesByType( input );
			expect( Object.keys( types ) ).to.have.length( 2 );
		} );

		it( 'returns a list of lines for each type', function() {
			var input = '  foobar1\n  foobar2\n\n\tfoobar3\n  foobar4';
			var types = IndentChecker.getLinesByType( input );
			expect( types.spaces ).to.have.length( 3 );
			expect( types.tabs ).to.have.length( 1 );
		} );
	} );

	describe( '.getMostCommonIndentType()', function() {
		it( 'returns "spaces" when the input contains more space indentations than tabs', function() {
			var input = '  foobar1\n  foobar2\n\tfoobar3\n  foobar4\n';
			expect( IndentChecker.getMostCommonIndentType( input ) ).to.equal( 'spaces' );
		} );

		it( 'returns "tabs" when the input contains more tabs indentations than spaces', function() {
			var input = '\tfoobar1\n\tfoobar2\n  foobar3\n\tfoobar4\n';
			expect( IndentChecker.getMostCommonIndentType( input ) ).to.equal( 'tabs' );
		} );

		it( 'returns "none" when the input contains equal tab and space indentation', function() {
			var input = '\tfoobar1\n  foobar2\n\tfoobar3\n  foobar4\n';
			expect( IndentChecker.getMostCommonIndentType( input ) ).to.equal( 'none' );
		} );
	} );

	describe( '.getLinesWithLessCommonType()', function() {
		it( 'returns an array of line numbers with the less-common indentation type from the input', function() {
			var input = '  foobar1\n  foobar2\n\tfoobar3\n  foobar4\n\tfoobar5';
			expect( IndentChecker.getLinesWithLessCommonType( input ) ).to.have.same.members( [ 3, 5 ] );
		} );

		it( 'returns an empty array if the input is entirely one type', function() {
			var input = '  foobar1\n  foobar2\n  foobar3\n  foobar4\n';
			expect( IndentChecker.getLinesWithLessCommonType( input ) ).to.be.empty;
		} );

		it( 'returns an empty array if the input indentation types are equal', function() {
			var input = '  foobar1\n  foobar2\n\tfoobar3\n\tfoobar4\n';
			expect( IndentChecker.getLinesWithLessCommonType( input ) ).to.be.empty;
		} );

		it( 'ignores comment block indentations', function() {
			var input = '\tfoobar1\n/** foobar2\n * foobar3\n * foobar4\n */\n foobar6\n\tfoobar7';
			expect( IndentChecker.getLinesWithLessCommonType( input ) ).to.have.same.members( [ 6 ] );
		} );
	} );

	describe( '.lint()', function() {
		it( 'returns an array of line numbers with the less-common indentation type from the input', function() {
			var input = '  foobar1\n  foobar2\n\tfoobar3\n  foobar4\n\tfoobar5';
			expect( IndentChecker.lint( input ) ).to.have.same.members( [ 3, 5 ] );
		} );

		it( 'returns an array of line numbers without the specified indentation type from the input, if option is set', function() {
			var input = '  foobar1\n  foobar2\n\tfoobar3\n  foobar4\n\tfoobar5';
			expect( IndentChecker.lint( input, { indent: 'tabs' } ) ).to.have.same.members( [ 1, 2, 4 ] );
		} );

		it( 'returns an array of line numbers including comments', function() {
			var input = '\tfoobar1\n  /** foobar2\n  * foobar3\n  * foobar4\n  */\n foobar6\n  // foobar7\n\tfoobar8';
			expect( IndentChecker.lint( input ) ).to.have.same.members( [ 1, 8 ] );
		} );

		it( 'returns an array of line numbers ignoring comments, if option is set', function() {
			var input = '\tfoobar1\n  /** foobar2\n  * foobar3\n  * foobar4\n  */\n foobar6\n  // foobar7\n\tfoobar8';
{'fraction_non_alphanumeric': 0.15678240241535477, 'fraction_numerical': 0.016389907267629934, 'mean_word_length': 3.524390243902439, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5803072', 'n_tokens_mistral': 3669, 'n_tokens_neox': 3282, 'n_words': 882}