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
Create this requirements.yml:
metadata:
urn: test
title: test
variant: microservice
Run this command
reqstool status local -p path/to/dir
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
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 likeNo requirements found
instead.Current Behavior
reqstool version: 0.3.1
Create this requirements.yml:
Run this command
reqstool status local -p path/to/dir
You get the following error