From 434389bf38c3b7b80ac2f55767ed63a0e8ed5468 Mon Sep 17 00:00:00 2001 From: krcb197 <34693973+krcb197@users.noreply.github.com> Date: Wed, 10 Aug 2022 23:28:30 +0100 Subject: [PATCH] Fixed pylint errors --- src/peakrdl_cheader/exporter.py | 3 -- src/peakrdl_cheader/peakcheader.py | 60 ------------------------------ 2 files changed, 63 deletions(-) diff --git a/src/peakrdl_cheader/exporter.py b/src/peakrdl_cheader/exporter.py index 1e602cf..9f4a566 100644 --- a/src/peakrdl_cheader/exporter.py +++ b/src/peakrdl_cheader/exporter.py @@ -3,9 +3,7 @@ """ import os from pathlib import Path -from shutil import copyfile from typing import List -from glob import glob import jinja2 as jj @@ -209,4 +207,3 @@ def create_empty_package(package_path:str) -> None: Path(package_path).mkdir(parents=True, exist_ok=True) Path(os.path.join(package_path, 'reg_model')).mkdir(parents=True, exist_ok=True) Path(os.path.join(package_path, 'tests')).mkdir(parents=True, exist_ok=True) - diff --git a/src/peakrdl_cheader/peakcheader.py b/src/peakrdl_cheader/peakcheader.py index 5ded4f2..f36249d 100644 --- a/src/peakrdl_cheader/peakcheader.py +++ b/src/peakrdl_cheader/peakcheader.py @@ -4,13 +4,8 @@ #!/usr/bin/env python3 import argparse -import os -import subprocess -import unittest.loader from typing import List, Optional -import coverage # type: ignore - from systemrdl import RDLCompiler # type: ignore from systemrdl.node import Node, AddrmapNode # type: ignore from peakrdl.ipxact import IPXACTImporter # type: ignore @@ -40,21 +35,9 @@ def build_command_line_parser() -> argparse.ArgumentParser: 'global addrmap)') parser.add_argument('--verbose', '-v', action='count', default=0, help='set logging verbosity') - parser.add_argument('--autoformat', action='store_true', - help='use autopep8 on generated code') parser.add_argument('--ipxact', dest='ipxact', nargs='*', type=str) - checker = parser.add_argument_group('post-generate checks') - checker.add_argument('--lint', action='store_true', - help='run pylint on the generated python') - checker.add_argument('--test', action='store_true', - help='run unittests for the created') - checker.add_argument('--coverage', action='store_true', - help='run a coverage report on the unittests') - checker.add_argument('--html_coverage_out', - help='output director (default: %(default)s)') - return parser @@ -108,22 +91,6 @@ def generate(root:Node, outdir:str) -> List[str]: return modules -def run_lint(root, outdir): - """ - Run the lint checks using pylint on a directory - - Args: - root: name of the generated package (directory) - outdir: location where the package has been written - - Returns: - - """ - subprocess.run(['pylint', '--rcfile', - os.path.join('tests','pylint.rc'), - os.path.join(outdir, root)], - check=False) - def main_function(): """ Main function for the Command Line tool, this needs to be separated out so that it can be @@ -148,32 +115,5 @@ def main_function(): print('***************************************************************') generate(spec, args.outdir) - if args.lint: - print('***************************************************************') - print('* Lint Checks *') - print('***************************************************************') - run_lint(outdir=args.outdir, root=spec.inst_name) - if args.test: - print('***************************************************************') - print('* Unit Test Run *') - print('***************************************************************') - if args.coverage: - cov = coverage.Coverage( - include=[f'*\\{spec.inst_name}\\reg_model\\*.py', - f'*\\{spec.inst_name}\\tests\\*.py']) - cov.start() - tests = unittest.TestLoader().discover( - start_dir=os.path.join(args.outdir, spec.inst_name, 'tests'), - top_level_dir=args.outdir) - runner = unittest.TextTestRunner() - runner.run(tests) - - if args.coverage: - cov.stop() - - if args.html_coverage_out is not None: - cov.html_report(directory=args.html_coverage_out) - - if __name__ == '__main__': main_function()