From 5a9f6c42a4a407fed19cc59e3e1bad563d645274 Mon Sep 17 00:00:00 2001 From: "Adwait M." <308045164+adwaitm1301@users.noreply.github.com> Date: Wed, 29 Jul 2026 22:50:40 +0530 Subject: [PATCH] fix: remove duplicate LaTeX imports, add row bounds safety, improve error messaging (#252) --- cover_letters/OpenFonts/cover.cls | 2 +- cover_letters/cover.cls | 15 +++++---------- tools/convert_salary_excel.py | 7 +++++-- tools/verify_pdf.py | 4 +++- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cover_letters/OpenFonts/cover.cls b/cover_letters/OpenFonts/cover.cls index 9333b7c..051a1ed 100644 --- a/cover_letters/OpenFonts/cover.cls +++ b/cover_letters/OpenFonts/cover.cls @@ -1,5 +1,5 @@ % Intro Options -\ProvidesClass{deedy-resume-openfont}[2014/04/30 CV class] +\ProvidesClass{cover}[2024/04/30 Cover letter class] \NeedsTeXFormat{LaTeX2e} \DeclareOption{print}{\def\@cv@print{}} \DeclareOption*{% diff --git a/cover_letters/cover.cls b/cover_letters/cover.cls index 52a4195..13c4139 100644 --- a/cover_letters/cover.cls +++ b/cover_letters/cover.cls @@ -1,5 +1,5 @@ % Intro Options -\ProvidesClass{deedy-resume-openfont}[2014/04/30 CV class] +\ProvidesClass{cover}[2024/04/30 Cover letter class] \NeedsTeXFormat{LaTeX2e} \DeclareOption{print}{\def\@cv@print{}} \DeclareOption*{% @@ -21,20 +21,16 @@ \renewcommand\refname{\vskip -1.5cm} % Color definitions -\usepackage[usenames,dvipsnames]{xcolor} -\definecolor{date}{HTML}{666666} -\definecolor{primary}{HTML}{2b2b2b} +\definecolor{date}{HTML}{666666} +\definecolor{primary}{HTML}{2b2b2b} \definecolor{headings}{HTML}{6A6A6A} \definecolor{subheadings}{HTML}{333333} % Set main fonts -\usepackage{fontspec} \setmainfont[Color=primary, Path = OpenFonts/fonts/lato/,BoldItalicFont=Lato-RegIta,BoldFont=Lato-Reg,ItalicFont=Lato-LigIta]{Lato-Lig} \setsansfont[Scale=MatchLowercase,Mapping=tex-text, Path = OpenFonts/fonts/raleway/]{Raleway-ExtraLight} % Date command -\usepackage[absolute]{textpos} -% \usepackage[UKenglish]{isodate} \setlength{\TPHorizModule}{1mm} \setlength{\TPVertModule}{1mm} \newcommand{\lastupdated}{\begin{textblock}{60}(155,5) @@ -56,9 +52,8 @@ Last Updated on \today \vspace{0pt} } -% Section seperators -\usepackage{titlesec} -\titlespacing{\section}{0pt}{0pt}{0pt} +% Section seperators +\titlespacing{\section}{0pt}{0pt}{0pt} \titlespacing{\subsection}{0pt}{0pt}{0pt} \newcommand{\sectionsep}{\vspace{8pt}} diff --git a/tools/convert_salary_excel.py b/tools/convert_salary_excel.py index 49c67c1..be190ca 100644 --- a/tools/convert_salary_excel.py +++ b/tools/convert_salary_excel.py @@ -189,11 +189,14 @@ def parse_sheet(ws, sheet_label=None): # Parse data rows companies = [] for row in ws.iter_rows(min_row=header_row + 1, values_only=True): - if not row[company_col]: + if company_col >= len(row) or not row[company_col]: continue company_name = str(row[company_col]).strip() - city_name = str(row[city_col]).strip() if city_col is not None and row[city_col] else "" + if city_col is not None and city_col < len(row) and row[city_col]: + city_name = str(row[city_col]).strip() + else: + city_name = "" entry = { "company": company_name, diff --git a/tools/verify_pdf.py b/tools/verify_pdf.py index f31c486..79b4dfd 100644 --- a/tools/verify_pdf.py +++ b/tools/verify_pdf.py @@ -22,7 +22,9 @@ def run_tool(command): ).stdout except FileNotFoundError as exc: raise VerificationError( - f"required command '{command[0]}' was not found; install poppler-utils" + f"required command '{command[0]}' was not found. " + "Install poppler-utils (macOS: brew install poppler, " + "Debian/Ubuntu: apt install poppler-utils, Windows: choco install poppler)" ) from exc except subprocess.CalledProcessError as exc: detail = (exc.stderr or "").strip() or (exc.stdout or "").strip()