luftfartsverket / reqstool-client

Reqstool is a tool for managing requirements with related software verification cases (aka tests) and verification results (test results)
https://luftfartsverket.github.io/reqstool-client/
MIT License
2 stars 0 forks source link

Exit status commad with appropriate message if no requirements are found #30

Closed lfvJonas closed 4 months ago

lfvJonas commented 8 months ago

Feature Request

Description

When running the status command on a project that does not contain any requirements you get a IndexError: list index out of range exception. It's hard to decypher what has gone wrong with this error. It would be preferred to get a message like No requirements found instead.

Current Behavior

reqstool version: 0.3.1

  1. Create this requirements.yml:

    metadata:
    urn: test
    title: test
    variant: microservice
  2. Run this command reqstool status local -p path/to/dir

  3. You get the following error

    Traceback (most recent call last):
    File "/home/u70565/.local/bin/reqstool", line 8, in <module>
    sys.exit(main())
    File "/home/u70565/.local/lib/python3.10/site-packages/reqstool/command.py", line 227, in main
    exit_code = command.command_status(status_args=args)
    File "/home/u70565/.local/lib/python3.10/site-packages/reqstool/command.py", line 201, in command_status
    result = StatusCommand(location=initial_source)
    File "/home/u70565/.local/lib/python3.10/site-packages/reqstool/commands/status/status.py", line 18, in __init__
    self.result = self.__status_result()
    File "/home/u70565/.local/lib/python3.10/site-packages/reqstool/commands/status/status.py", line 25, in __status_result
    status = _status_table(stats_container=statistics)
    File "/home/u70565/.local/lib/python3.10/site-packages/reqstool/commands/status/status.py", line 64, in _status_table
    col_align = ["center"] * len(table_data[0])
    IndexError: list index out of range
lfvmarcus commented 5 months ago

Version 0.3.1 is quite old. I cannot reproduce it in the latest version (0.4.4). Is this still a problem?

lfvJonas commented 5 months ago

I still get this error message in 0.4.4 and I think there should be a more appropriate error message