def METHOD_NAME(
    project: Project,
    reload: bool,
    link: Optional[str],
    interval: float,
):
    """Watch the project directory and build on file changes."""
    text = "Linking and watching project..." if link else "Watching project..."
    with message_fence(text):
        if link:
            click.echo(project.link(world=link))
        for changes in project.METHOD_NAME(interval):
            filename, action = next(iter(changes.items()))
            text = (
                f'{action.capitalize()} "{filename}"'
                if changes == {filename: action}
                else f"{len(changes)} changes detected"
            )
            now = time.strftime("%H:%M:%S")
            change_time = click.style(now, fg="green", bold=True)
            click.echo(f"{change_time} {text}")
            with error_handler(format_padding=1), project.override(
                reload and "require[] = beet.contrib.livereload"
            ):
                project.build()