Skip to content

Gracefully handle "task --list" when there are no tasks#52

Merged
illBeRoy merged 1 commit intomasterfrom
poetry-l-no-tasks
Aug 31, 2022
Merged

Gracefully handle "task --list" when there are no tasks#52
illBeRoy merged 1 commit intomasterfrom
poetry-l-no-tasks

Conversation

@illBeRoy
Copy link
Copy Markdown
Collaborator

Description

This PR adds graceful handling of the task --list command under two circumstances:

One: There is no "tasks" section in pyproject.toml:
image

Two: The "tasks" section is empty:
image

This also fixes issue #51

Changes

  1. Created two new test cases under ListTasksTestCase for each edge case
  2. Created a new exception class: EmptyTasksSectionError
  3. Updated HelpFormatter to raise the aforementioned exception in case the tasks list is empty
  4. Renamed HelpFormatter into TasksListFormatter to better emphasize its role in the system (also renamed file from help.py to list.py)

Copy link
Copy Markdown
Contributor

@eugenetriguba eugenetriguba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for fixing this 👍

@eugenetriguba
Copy link
Copy Markdown
Contributor

Closes #51

@illBeRoy illBeRoy merged commit 62b47b6 into master Aug 31, 2022
@eugenetriguba eugenetriguba deleted the poetry-l-no-tasks branch May 20, 2023 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants