Skip to content

Commit 4e6bd63

Browse files
committed
Fix formatting and linting issues
1 parent 7138cee commit 4e6bd63

7 files changed

Lines changed: 46 additions & 22 deletions

File tree

.claude/settings.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"hooks": {
3+
"PostToolUse": [
4+
{
5+
"matcher": "Edit|Write",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "cd \"$CLAUDE_PROJECT_DIR\" && just check",
10+
"timeout": 120,
11+
"statusMessage": "Running just check...",
12+
}
13+
],
14+
}
15+
]
16+
}
17+
}

scripts/ats_proof/analyze_pdfs.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from pathlib import Path
1212

1313
import fitz # PyMuPDF
14-
1514
from common import (
1615
RENDERED_DIR,
1716
RESULTS_DIR,
@@ -23,7 +22,7 @@
2322
normalize_quotes,
2423
write_json,
2524
)
26-
25+
from ruamel.yaml import YAML
2726

2827
# ---------------------------------------------------------------------------
2928
# Extractors
@@ -102,8 +101,6 @@ def analyze_pdf(pdf_path: Path) -> dict:
102101
# Get CV name for reading order check
103102
name = ""
104103
if yaml_path:
105-
from ruamel.yaml import YAML
106-
107104
yaml = YAML()
108105
with yaml_path.open(encoding="utf-8") as f:
109106
data = yaml.load(f)
@@ -227,18 +224,18 @@ def main() -> None:
227224
)
228225

229226
# Print summary
230-
print(
227+
print( # noqa: T201
231228
f"\nStructural: {structural_pass}/{len(pdfs)} passed ({structural_summary['pass_rate']})"
232-
) # noqa: T201
229+
)
233230
for name, s in extraction_summary["extractors"].items():
234-
print(
231+
print( # noqa: T201
235232
f"Extraction ({name}): {s['average_accuracy']} avg accuracy, {s['garbled_count']} garbled"
236-
) # noqa: T201
233+
)
237234

238235
if structural_pass < len(pdfs):
239-
print(
236+
print( # noqa: T201
240237
f"\nWARNING: {len(pdfs) - structural_pass} PDFs failed structural analysis."
241-
) # noqa: T201
238+
)
242239
sys.exit(1)
243240

244241

scripts/ats_proof/evaluate.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
write_json,
1919
)
2020

21-
2221
# ---------------------------------------------------------------------------
2322
# Matching functions
2423
# ---------------------------------------------------------------------------
@@ -28,8 +27,7 @@ def normalize(text: str) -> str:
2827
"""Normalize text for comparison."""
2928
text = text.lower().strip()
3029
text = re.sub(r"\s+", " ", text)
31-
text = re.sub(r"[^\w\s@.+\-/]", "", text)
32-
return text
30+
return re.sub(r"[^\w\s@.+\-/]", "", text)
3331

3432

3533
def exact_match(expected: str, extracted: str) -> float:

scripts/ats_proof/generate_report.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from pathlib import Path
88

99
import jinja2
10-
1110
from common import (
1211
ANALYSIS_DIR,
1312
RENDERED_DIR,

scripts/ats_proof/render_pdfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
import tempfile
99
from pathlib import Path
1010

11+
from common import RENDERED_DIR, THEMES, find_corpus_yamls
12+
1113
from rendercv.cli.render_command.progress_panel import ProgressPanel
1214
from rendercv.cli.render_command.run_rendercv import run_rendercv
1315

14-
from common import RENDERED_DIR, THEMES, find_corpus_yamls
15-
1616

1717
def render_with_theme(yaml_path: Path, theme: str, output_dir: Path) -> Path | None:
1818
"""Render a corpus YAML with a given theme using the RenderCV API."""

scripts/ats_proof/submit_commercial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from pathlib import Path
1313

1414
import httpx
15-
1615
from common import RENDERED_DIR, RESULTS_DIR, find_rendered_pdfs, write_json
1716

1817
RESULTS_SUBDIR: str = "commercial/edenai"

tests/renderer/templater/test_entry_templates_from_input.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,9 +691,17 @@ class TestRemoveConnectorsOfMissingPlaceholders:
691691
# No connector word to remove (just space) — stays as-is
692692
("AREA DEGREE", {"DEGREE"}, "AREA DEGREE"),
693693
# Formatting preserved, only connector word removed
694-
("**INSTITUTION**, DEGREE in AREA -- LOCATION", {"DEGREE"}, "**INSTITUTION**, DEGREE AREA -- LOCATION"),
694+
(
695+
"**INSTITUTION**, DEGREE in AREA -- LOCATION",
696+
{"DEGREE"},
697+
"**INSTITUTION**, DEGREE AREA -- LOCATION",
698+
),
695699
# Connector "at" removed between JOB_TITLE and COMPANY
696-
("**JOB_TITLE** at COMPANY_NAME", {"COMPANY_NAME"}, "**JOB_TITLE** COMPANY_NAME"),
700+
(
701+
"**JOB_TITLE** at COMPANY_NAME",
702+
{"COMPANY_NAME"},
703+
"**JOB_TITLE** COMPANY_NAME",
704+
),
697705
# No connector between placeholders separated by punctuation only
698706
("NAME, LOCATION", {"LOCATION"}, "NAME, LOCATION"),
699707
# Hindi connector removed
@@ -721,7 +729,9 @@ def test_no_connector_word_when_degree_is_none(self):
721729
entry,
722730
templates=Templates(
723731
education_entry=EducationEntryOptions(
724-
main_column="**INSTITUTION**, DEGREE_WITH_AREA\nSUMMARY\nHIGHLIGHTS",
732+
main_column=(
733+
"**INSTITUTION**, DEGREE_WITH_AREA\nSUMMARY\nHIGHLIGHTS"
734+
),
725735
degree_column=None,
726736
)
727737
),
@@ -745,7 +755,9 @@ def test_no_connector_word_in_french_when_degree_is_none(self):
745755
entry,
746756
templates=Templates(
747757
education_entry=EducationEntryOptions(
748-
main_column="**INSTITUTION**, DEGREE_WITH_AREA\nSUMMARY\nHIGHLIGHTS",
758+
main_column=(
759+
"**INSTITUTION**, DEGREE_WITH_AREA\nSUMMARY\nHIGHLIGHTS"
760+
),
749761
degree_column=None,
750762
)
751763
),
@@ -770,7 +782,9 @@ def test_no_connector_word_when_area_is_empty(self):
770782
entry,
771783
templates=Templates(
772784
education_entry=EducationEntryOptions(
773-
main_column="**INSTITUTION**, DEGREE_WITH_AREA\nSUMMARY\nHIGHLIGHTS",
785+
main_column=(
786+
"**INSTITUTION**, DEGREE_WITH_AREA\nSUMMARY\nHIGHLIGHTS"
787+
),
774788
degree_column=None,
775789
)
776790
),

0 commit comments

Comments
 (0)