mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 00:26:26 +00:00
fix(security-guards): sync gitignore guard with the Cover_*.* and cv/*.txt rules
Two personal-data ignore rules existed in .gitignore but not in REQUIRED_IGNORE_RULES, so a change weakening either would have passed CI: cover_letters/Cover_*.* (the uppercase naming variant /apply recognizes) and cv/*.txt (ATS text extractions of tailored CVs). Also: regression tests pinning #252's ragged-row bounds fix in convert_salary_excel.py (mutation-verified), and removal of the vestigial cover_letters/OpenFonts/cover.cls, which since #252's rename ambiguously declared the same class as the real cover.cls (zero references; cover letter re-compiled and page-verified after removal). Guard-list gap surfaced by CodeRabbit's review on jakob1379's Nix demo fork PR (jakob1379/ai-job-search#1). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
f220d92495
commit
2c41210019
@@ -120,6 +120,39 @@ class DetectColumnTypeTests(unittest.TestCase):
|
||||
self.assertEqual(len(companies), 1)
|
||||
self.assertEqual(companies[0]["city"], "Aarhus")
|
||||
|
||||
def test_parse_sheet_handles_ragged_rows(self):
|
||||
# openpyxl's read_only mode yields ragged tuples for dimension-less
|
||||
# workbooks: a row can be shorter than the header. A company row that
|
||||
# omits its city and category cells must parse without an IndexError,
|
||||
# be retained, and get an empty city.
|
||||
ws = FakeWorksheet([
|
||||
("Company", "City", "Engineering Count", "Engineering Index"),
|
||||
("Example Corp",),
|
||||
("Other Corp", "Aarhus", 12, 105.5),
|
||||
])
|
||||
|
||||
companies = parse_sheet(ws)
|
||||
|
||||
self.assertEqual(len(companies), 2)
|
||||
self.assertEqual(companies[0]["company"], "Example Corp")
|
||||
self.assertEqual(companies[0]["city"], "")
|
||||
self.assertEqual(companies[0]["categories"], {})
|
||||
self.assertEqual(companies[1]["categories"]["engineering"], {"count": 12, "index": 105.5})
|
||||
|
||||
def test_parse_sheet_skips_row_shorter_than_company_column(self):
|
||||
# A ragged row that ends before the company column has no company cell
|
||||
# at all; it must be skipped, not crash the parse.
|
||||
ws = FakeWorksheet([
|
||||
("Notes", "Company", "Salary Index"),
|
||||
("stray",),
|
||||
("", "Example Corp", 105.5),
|
||||
])
|
||||
|
||||
companies = parse_sheet(ws)
|
||||
|
||||
self.assertEqual(len(companies), 1)
|
||||
self.assertEqual(companies[0]["company"], "Example Corp")
|
||||
|
||||
def test_skips_free_text_column(self):
|
||||
# A free-text "Notes" column must not become a bogus salary category.
|
||||
ws = FakeWorksheet([
|
||||
|
||||
Reference in New Issue
Block a user