Skip to content

Make add_task parameters non-optional #11

@nicolasfwyss

Description

@nicolasfwyss

Description:

The current implementation of the add_task method allows the title and description parameters to be optional. However, for a task management system, having a title and description for each task is crucial for clarity and organization. Allowing these parameters to be optional can lead to tasks without meaningful identifiers or context, which reduces the usability of the system.

Suggested Changes

Make title and description Mandatory:
Update the add_task method to require title and description parameters. This ensures that every task has a meaningful identifier and context.

Example Code Changes

Original Code

def add_task(self, title='', description="", deadline='',
                category=None, priority=0, status="To Do",
                completion_time=None, duration_planned=None,
                duration=None, points=0):
    """Add a task to the tasklist."""

Improved Code

Code kopieren
def add_task(self, title, description, deadline='',
                category=None, priority=0, status="To Do",
                completion_time=None, duration_planned=None,
                duration=None, points=0):
    """
    Add a task to the tasklist. 

    Args:
        title (str): The title of the task.
        description (str): The description of the task.
        deadline (str, optional): The deadline for the task.
        category (str, optional): The category of the task.
        priority (int, optional): The priority level of the task.
        status (str, optional): The current status of the task.
        completion_time (str, optional): The completion time of the task.
        duration_planned (str, optional): The planned duration for the task.
        duration (str, optional): The actual duration of the task.
        points (int, optional): The points assigned to the task.
    """ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions