Skip to content

Improve error reporting #30

@cc-a

Description

@cc-a

Any problems found in the analysis run by the tool are stored as instances of unit_static_analyser.checker.errors.UnitCheckerError. The output for these is currently not formatted at all and we just print the __repr__ of the instances. This output could be more nicely formatted with the module name and line number where the error occurred. Most of the relevant information is already stored in the UnitCheckerError instance with the exception of the module name. This issue covers:

  • Adding a module_name attribute to UnitCheckerError.
  • Extending the error factory functions in unit_static_analyser.checker.errors to take and store module names.
  • Updating all calls to error factories in unit_static_analyser.checker to pass self.current_module_name.
  • Updating the printing of errors in unit_static_analyser/__init__.py to be nicely formatted with module name and line number.
  • Update the assert_error function in test_checker.py to check that the module name is correctly specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions