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

11 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2022-09-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/tsfpga/hdl_registers 

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

9 

10from tsfpga.git_utils import find_git_files 

11from tsfpga.test.lint.test_python_lint import run_black, run_flake8_lint, run_pylint 

12 

13from hdl_registers import REPO_ROOT, HDL_REGISTERS_DOC 

14 

15 

16def _files_to_test(): 

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

18 return [ 

19 str(path) 

20 for path in find_git_files( 

21 directory=REPO_ROOT, 

22 exclude_directories=[HDL_REGISTERS_DOC], 

23 file_endings_include="py", 

24 ) 

25 ] 

26 

27 

28def test_pylint(): 

29 run_pylint(_files_to_test()) 

30 

31 

32def test_flake8_lint(): 

33 run_flake8_lint(_files_to_test()) 

34 

35 

36def test_black_formatting(): 

37 run_black(_files_to_test())