Coverage for hdl_registers/test/lint/test_python_lint.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2023-01-29 22:03 +0000

1# -------------------------------------------------------------------------------------------------- 

2# Copyright (c) Lukas Vik. All rights reserved. 

3# 

4# This file is part of the hdl_registers project, a HDL register generator fast enough to be run 

5# in real time. 

6# https://hdl-registers.com 

7# https://gitlab.com/hdl_registers/hdl_registers 

8# -------------------------------------------------------------------------------------------------- 

9 

10# Third party libraries 

11from tsfpga.git_utils import find_git_files 

12from tsfpga.test.lint.test_python_lint import run_black, run_flake8_lint, run_isort, run_pylint 

13 

14# First party libraries 

15from hdl_registers import HDL_REGISTERS_DOC, REPO_ROOT 

16 

17 

18def _files_to_check(): 

19 # Exclude doc folder, since conf.py used by sphinx does not conform 

20 return [ 

21 str(path) 

22 for path in find_git_files( 

23 directory=REPO_ROOT, 

24 exclude_directories=[HDL_REGISTERS_DOC], 

25 file_endings_include="py", 

26 ) 

27 ] 

28 

29 

30def test_pylint(): 

31 run_pylint(_files_to_check()) 

32 

33 

34def test_flake8_lint(): 

35 run_flake8_lint(_files_to_check()) 

36 

37 

38def test_black_formatting(): 

39 run_black(_files_to_check()) 

40 

41 

42def test_isort_formatting(): 

43 run_isort(files=_files_to_check(), cwd=REPO_ROOT)