import re


def _single_file_loc(file_path: str) -> int:
    """ Count LOC for one file. """
    _loc = 0
    _file = open(file_path, 'r', errors='ignore')
    for line in _file:
        if not re.match(r'^\s*$', line):
            _loc = _loc + 1

    return _loc