Skip to content

Commit

Permalink
issue #111 replace has_no_long_files validator to pre-validate
Browse files Browse the repository at this point in the history
  • Loading branch information
Ranc58 committed Apr 26, 2018
1 parent a363126 commit a1bb76f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions fiasko_bro/pre_validation_checks/files_len.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from ..utils import url_helpers


def has_no_long_files(solution_repo, max_number_of_lines, *args, **kwargs):
for file_path, file_content, _ in solution_repo.get_ast_trees(
with_filenames=True,
with_file_content=True
):
number_of_lines = file_content.count('\n')
if number_of_lines > max_number_of_lines:
file_name = url_helpers.get_filename_from_path(file_path)
return 'file_too_long', file_name

0 comments on commit a1bb76f

Please sign in to comment.