Adds ROOT_DIR to path and performs lint checks. This functions exits the program with status code of lint check.
(lint_args)
| 692 | print("HTML output generated under build/lcov/") |
| 693 | |
| 694 | def check_lint(lint_args): |
| 695 | """ |
| 696 | Adds ROOT_DIR to path and performs lint checks. |
| 697 | This functions exits the program with status code of lint check. |
| 698 | """ |
| 699 | sys.path.append(ROOT_DIR) |
| 700 | try: |
| 701 | from tools.linter import DiffLinter |
| 702 | except ModuleNotFoundError as e: |
| 703 | print(f"Error: {e.msg}. " |
| 704 | "Install using linter_requirements.txt.") |
| 705 | sys.exit(1) |
| 706 | |
| 707 | uncommitted = lint_args == "uncommitted" |
| 708 | branch = "main" if uncommitted else lint_args |
| 709 | |
| 710 | DiffLinter(branch).run_lint(uncommitted) |
| 711 | |
| 712 | |
| 713 | if __name__ == "__main__": |
no test coverage detected