<commit_before>#include <stdio.h>

void
check_file(int *had_err, const char *fn)
{
	FILE *fp;
	int ln_nbr;
	char ln[4096];
	int msgs = 0;
	int max_msgs = 2;
	
	if ((fp = fopen (fn, "r")) == NULL) {
		perror (fn);
		*had_err = 1;
		return;
	}

	ln_nbr = 1;
	while (fgets (ln, sizeof(ln), fp) != NULL) {
		if (ln[0] == ' ' && ln[1] != '*') {
			if (msgs < max_msgs) {
				fprintf(stderr, "error: %s:%d: invalid indention (SP at column 1):"
					"\n%s\n", fn, ln_nbr, ln);
				*had_err = 1;
				++msgs;
			}
		}
		++ln_nbr;
	}

	fclose (fp);
}


int
main(int argc, char *argv[])
{
	int had_err = 0;
	for(int i = 1 ; i < argc ; ++i) {
		check_file(&had_err, argv[i]);
	}
	return had_err;
}<commit_msg>emit more message and warning, if even more could be found<commit_after>#include <stdio.h>

void
check_file(int *had_err, const char *fn)
{
	FILE *fp;
	int ln_nbr;
	char ln[4096];
	int msgs = 0;
	int max_msgs = 20;
	
	if ((fp = fopen (fn, "r")) == NULL) {
		perror (fn);
		*had_err = 1;
		return;
	}

	ln_nbr = 1;
	while (fgets (ln, sizeof(ln), fp) != NULL) {
		if (ln[0] == ' ' && ln[1] != '*') {
			if(msgs == max_msgs) {
				fprintf(stderr, "reached max %d messages, not reporting more\n",
					max_msgs);
				goto done;
			}
			fprintf(stderr, "error: %s:%d: invalid indention (SP at column 1):"
				"\n%s\n", fn, ln_nbr, ln);
			*had_err = 1;
			++msgs;
		}
		++ln_nbr;
	}

done:
	fclose (fp);
}


int
main(int argc, char *argv[])
{
	int had_err = 0;
	for(int i = 1 ; i < argc ; ++i) {
		check_file(&had_err, argv[i]);
	}
	return had_err;
}
{'fraction_non_alphanumeric': 0.19714656290531776, 'fraction_numerical': 0.01880674448767834, 'mean_word_length': 2.9974093264248705, 'pattern_counts': {'":': 0, '<': 8, '<?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': '1399593', 'n_tokens_mistral': 802, 'n_tokens_neox': 705, 'n_words': 185}