ruff check fixes

This commit is contained in:
Taylor Wilsdon
2025-08-12 09:37:20 -04:00
parent 004a462496
commit 8ff093dc20
5 changed files with 16 additions and 28 deletions

View File

@@ -24,24 +24,17 @@ from gdocs.docs_helpers import (
create_insert_table_request,
create_insert_page_break_request,
create_insert_image_request,
create_bullet_list_request,
validate_operation
create_bullet_list_request
)
# Import document structure and table utilities
from gdocs.docs_structure import (
parse_document_structure,
find_tables,
get_table_cell_indices,
find_element_at_index,
analyze_document_complexity
)
from gdocs.docs_tables import (
build_table_population_requests,
format_table_data,
validate_table_data,
extract_table_as_data,
find_table_by_content
extract_table_as_data
)
# Import operation managers for complex business logic
@@ -423,11 +416,16 @@ async def modify_doc_text(
requests.append(create_format_text_request(format_start, format_end, bold, italic, underline, font_size, font_family))
format_details = []
if bold is not None: format_details.append(f"bold={bold}")
if italic is not None: format_details.append(f"italic={italic}")
if underline is not None: format_details.append(f"underline={underline}")
if font_size: format_details.append(f"font_size={font_size}")
if font_family: format_details.append(f"font_family={font_family}")
if bold is not None:
format_details.append(f"bold={bold}")
if italic is not None:
format_details.append(f"italic={italic}")
if underline is not None:
format_details.append(f"underline={underline}")
if font_size:
format_details.append(f"font_size={font_size}")
if font_family:
format_details.append(f"font_family={font_family}")
operations.append(f"Applied formatting ({', '.join(format_details)}) to range {format_start}-{format_end}")
@@ -524,7 +522,7 @@ async def insert_doc_elements(
# Handle the special case where we can't insert at the first section break
# If index is 0, bump it to 1 to avoid the section break
if index == 0:
logger.debug(f"Adjusting index from 0 to 1 to avoid first section break")
logger.debug("Adjusting index from 0 to 1 to avoid first section break")
index = 1
requests = []
@@ -602,7 +600,7 @@ async def insert_doc_image(
# Handle the special case where we can't insert at the first section break
# If index is 0, bump it to 1 to avoid the section break
if index == 0:
logger.debug(f"Adjusting index from 0 to 1 to avoid first section break")
logger.debug("Adjusting index from 0 to 1 to avoid first section break")
index = 1
# Determine if source is a Drive file ID or URL
@@ -961,7 +959,6 @@ async def create_table_with_data(
link = f"https://docs.google.com/document/d/{document_id}/edit"
rows = metadata.get('rows', 0)
columns = metadata.get('columns', 0)
populated_cells = metadata.get('populated_cells', 0)
return f"SUCCESS: {message}. Table: {rows}x{columns}, Index: {index}. Link: {link}"
else: