fix: apply ruff formatting to pass CI checks

- Fixed line length issues in logger.warning calls
- Removed trailing spaces in docstrings
- Applied consistent formatting across all files
This commit is contained in:
Neovasky
2025-07-28 11:52:10 -04:00
parent 3ddeeab67f
commit 83748a27da
3 changed files with 14 additions and 11 deletions
+6 -3
View File
@@ -125,10 +125,14 @@ class CalendarClient(BaseNextcloudClient):
except HTTPStatusError as e: except HTTPStatusError as e:
if e.response.status_code == 401: if e.response.status_code == 401:
logger.warning("Authentication failed for CalDAV - Calendar app may not be enabled for this user") logger.warning(
"Authentication failed for CalDAV - Calendar app may not be enabled for this user"
)
return [] return []
elif e.response.status_code == 404: elif e.response.status_code == 404:
logger.warning("CalDAV endpoint not found - Calendar app may not be installed") logger.warning(
"CalDAV endpoint not found - Calendar app may not be installed"
)
return [] return []
logger.error(f"HTTP error listing calendars: {e}") logger.error(f"HTTP error listing calendars: {e}")
raise e raise e
@@ -435,7 +439,6 @@ class CalendarClient(BaseNextcloudClient):
# Add alarms/reminders # Add alarms/reminders
reminder_minutes = event_data.get("reminder_minutes", 0) reminder_minutes = event_data.get("reminder_minutes", 0)
if reminder_minutes > 0: if reminder_minutes > 0:
alarm = Alarm() alarm = Alarm()
alarm.add("action", "DISPLAY") alarm.add("action", "DISPLAY")
alarm.add("description", "Event reminder") alarm.add("description", "Event reminder")
+6 -6
View File
@@ -372,7 +372,7 @@ async def nc_calendar_create_event(
color: str = "", color: str = "",
): ):
"""Create a comprehensive calendar event with full feature support """Create a comprehensive calendar event with full feature support
Args: Args:
calendar_name: Name of the calendar to create the event in calendar_name: Name of the calendar to create the event in
title: Event title title: Event title
@@ -394,7 +394,7 @@ async def nc_calendar_create_event(
attendees: Comma-separated email addresses attendees: Comma-separated email addresses
url: Related URL for the event url: Related URL for the event
color: Event color (hex or name) color: Event color (hex or name)
Returns: Returns:
Dict with event creation result Dict with event creation result
""" """
@@ -609,16 +609,16 @@ async def nc_calendar_create_meeting(
reminder_minutes: int = 15, reminder_minutes: int = 15,
): ):
"""Quick meeting creation with smart defaults """Quick meeting creation with smart defaults
This is a convenience function for creating events with common meeting defaults. This is a convenience function for creating events with common meeting defaults.
It automatically: It automatically:
- Calculates end time based on duration - Calculates end time based on duration
- Sets status to CONFIRMED - Sets status to CONFIRMED
- Adds a reminder - Adds a reminder
- Uses simpler date/time inputs instead of full ISO format - Uses simpler date/time inputs instead of full ISO format
For full control over all event properties, use nc_calendar_create_event instead. For full control over all event properties, use nc_calendar_create_event instead.
Args: Args:
title: Meeting title title: Meeting title
date: Meeting date (YYYY-MM-DD format, e.g., "2025-01-15") date: Meeting date (YYYY-MM-DD format, e.g., "2025-01-15")
@@ -630,7 +630,7 @@ async def nc_calendar_create_meeting(
location: Meeting location location: Meeting location
description: Meeting description/agenda description: Meeting description/agenda
reminder_minutes: Minutes before meeting to send reminder (default: 15) reminder_minutes: Minutes before meeting to send reminder (default: 15)
Returns: Returns:
Dict with meeting creation result Dict with meeting creation result
""" """
@@ -95,10 +95,10 @@ async def test_list_calendars(nc_client: NextcloudClient):
calendars = await nc_client.calendar.list_calendars() calendars = await nc_client.calendar.list_calendars()
assert isinstance(calendars, list) assert isinstance(calendars, list)
if not calendars: if not calendars:
pytest.skip("No calendars available - Calendar app may not be enabled") pytest.skip("No calendars available - Calendar app may not be enabled")
logger.info(f"Found {len(calendars)} calendars") logger.info(f"Found {len(calendars)} calendars")
# Check structure of calendars # Check structure of calendars