this derivation will be built: /nix/store/zy05r89dg2hazv5nrx94r5k02a0skq0c-treefmt-check.drv building '/nix/store/zy05r89dg2hazv5nrx94r5k02a0skq0c-treefmt-check.drv' treefmt-check> treefmt v2.5.0ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 treefmt-check> treefmt-check> DTZ011 `datetime.date.today()` used treefmt-check> --> eval/seed-recall/run.py:107:20 treefmt-check> | treefmt-check> 106 | db = PGStore(settings.pg_conninfo) treefmt-check> 107 | current_year = datetime.date.today().year treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 108 | seed_scores: list[tuple[str, float]] = [] treefmt-check> 109 | for seed in seeds: treefmt-check> | treefmt-check> help: Use `datetime.datetime.now(tz=...).date()` instead treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> quarry/assets/download.py:237:11 treefmt-check> | treefmt-check> 236 | # Dry-run to count pending operations treefmt-check> 237 | dry = subprocess.run( treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 238 | base_cmd + ["--dryrun"], treefmt-check> 239 | capture_output=True, treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> quarry/assets/load.py:403:16 treefmt-check> | treefmt-check> 401 | def _optimize(table: str) -> tuple[str, int, str]: treefmt-check> 402 | query = f"OPTIMIZE TABLE {table} FINAL" treefmt-check> 403 | proc = subprocess.run( treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 404 | _ch_client_cmd() + ["--query", query], treefmt-check> 405 | capture_output=True, treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> ISC004 Unparenthesized implicit string concatenation in collection treefmt-check> --> quarry/assets/load.py:510:9 treefmt-check> | treefmt-check> 508 | "papers_export", treefmt-check> 509 | "papers", treefmt-check> 510 | / "pmid, doi, pmc_id, title, abstract, pub_year, pub_date, " treefmt-check> 511 | | "journal_title, journal_issn, journal_abbr, volume, issue, pages, " treefmt-check> 512 | | "language, pub_type, country, medline_status, created_date, revised_date, " treefmt-check> 513 | | "indexed_date, is_deleted, deleted_date, rcr, nih_percentile, apt, " treefmt-check> 514 | | "is_clinical, human, animal, molecular_cellular, field_citation_rate", treefmt-check> | |_____________________________________________________________________________^ treefmt-check> 515 | ), treefmt-check> 516 | ( treefmt-check> | treefmt-check> help: Did you forget a comma? treefmt-check> help: Wrap implicitly concatenated strings in parentheses treefmt-check> treefmt-check> ISC004 Unparenthesized implicit string concatenation in collection treefmt-check> --> quarry/assets/load.py:519:9 treefmt-check> | treefmt-check> 517 | "oa_work_authors", treefmt-check> 518 | "work_authors", treefmt-check> 519 | / "work_id, author_position, display_name, orcid, " treefmt-check> 520 | | "institution_name, institution_ror, raw_affiliation", treefmt-check> | |____________________________________________________________^ treefmt-check> 521 | ), treefmt-check> 522 | ( treefmt-check> | treefmt-check> help: Did you forget a comma? treefmt-check> help: Wrap implicitly concatenated strings in parentheses treefmt-check> treefmt-check> ISC004 Unparenthesized implicit string concatenation in collection treefmt-check> --> quarry/assets/load.py:530:9 treefmt-check> | treefmt-check> 528 | "pm_authors", treefmt-check> 529 | "authors", treefmt-check> 530 | / "pmid, author_position, last_name, fore_name, initials, " treefmt-check> 531 | | "orcid, affiliation, is_collective", treefmt-check> | |___________________________________________^ treefmt-check> 532 | ), treefmt-check> 533 | ( treefmt-check> | treefmt-check> help: Did you forget a comma? treefmt-check> help: Wrap implicitly concatenated strings in parentheses treefmt-check> treefmt-check> ISC004 Unparenthesized implicit string concatenation in collection treefmt-check> --> quarry/assets/load.py:536:9 treefmt-check> | treefmt-check> 534 | "pm_mesh_headings", treefmt-check> 535 | "mesh_headings", treefmt-check> 536 | / "pmid, descriptor_ui, descriptor_name, qualifier_ui, " treefmt-check> 537 | | "qualifier_name, is_major_topic", treefmt-check> | |________________________________________^ treefmt-check> 538 | ), treefmt-check> 539 | ("pm_grants", "grants", "pmid, grant_id, acronym, agency, country"), treefmt-check> | treefmt-check> help: Did you forget a comma? treefmt-check> help: Wrap implicitly concatenated strings in parentheses treefmt-check> treefmt-check> ISC004 Unparenthesized implicit string concatenation in collection treefmt-check> --> quarry/assets/load.py:557:9 treefmt-check> | treefmt-check> 555 | "work_mesh_export", treefmt-check> 556 | "work_mesh", treefmt-check> 557 | / "work_id, descriptor_ui, descriptor_name, qualifier_ui, " treefmt-check> 558 | | "qualifier_name, is_major_topic", treefmt-check> | |________________________________________^ treefmt-check> 559 | ), treefmt-check> 560 | ("cited_by_clin_export", "cited_by_clin", "pmid, citing_pmid"), treefmt-check> | treefmt-check> help: Did you forget a comma? treefmt-check> help: Wrap implicitly concatenated strings in parentheses treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> quarry/assets/load.py:574:16 treefmt-check> | treefmt-check> 572 | cmd = _ch_client_cmd() + ["--query", query + " FORMAT Parquet"] treefmt-check> 573 | with open(out_path, "wb") as f: treefmt-check> 574 | return subprocess.run(cmd, stdout=f, stderr=subprocess.PIPE, text=True) treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/assets/load.py:843:20 treefmt-check> | treefmt-check> 841 | done += 1 treefmt-check> 842 | context.log.info(f"[PG] {name} done [{done}/{total}]") treefmt-check> 843 | except Exception as exc: treefmt-check> | ^^^^^^^^^ treefmt-check> 844 | context.log.error(f"[PG] {name} failed: {exc}") treefmt-check> 845 | failed.append(name) treefmt-check> | treefmt-check> treefmt-check> B008 Do not perform function call `typer.Argument` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable treefmt-check> --> quarry/cli.py:56:27 treefmt-check> | treefmt-check> 54 | @app.command() treefmt-check> 55 | def info( treefmt-check> 56 | work_ids: list[str] = typer.Argument( treefmt-check> | ___________________________^ treefmt-check> 57 | | ..., help="One or more work IDs: W, DOI, PMID" treefmt-check> 58 | | ), treefmt-check> | |_____^ treefmt-check> 59 | full: bool = typer.Option(False, "--full", help="Show full abstract"), treefmt-check> 60 | show_mesh: bool = typer.Option(False, "--mesh", help="Show MeSH descriptors"), treefmt-check> | treefmt-check> treefmt-check> PIE810 Call `startswith` once with a `tuple` treefmt-check> --> quarry/cli.py:163:8 treefmt-check> | treefmt-check> 162 | # DOI treefmt-check> 163 | if identifier.startswith("10.") or identifier.startswith("https://doi.org/"): treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 164 | doi = "https://doi.org/" + identifier.removeprefix("https://doi.org/").lower() treefmt-check> 165 | return db.get_work_by_doi(doi) treefmt-check> | treefmt-check> help: Merge into a single `startswith` call treefmt-check> treefmt-check> B008 Do not perform function call `typer.Argument` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable treefmt-check> --> quarry/cli.py:690:24 treefmt-check> | treefmt-check> 688 | @app.command() treefmt-check> 689 | def bridge( treefmt-check> 690 | seeds: list[str] = typer.Argument( treefmt-check> | ________________________^ treefmt-check> 691 | | ..., treefmt-check> 692 | | help="Two or more seed papers: work_id_int, W, DOI, or https://doi.org/...", treefmt-check> 693 | | ), treefmt-check> | |_____^ treefmt-check> 694 | types: list[str] = typer.Option( treefmt-check> 695 | None, treefmt-check> | treefmt-check> treefmt-check> B008 Do not perform function call `typer.Option` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable treefmt-check> --> quarry/cli.py:694:24 treefmt-check> | treefmt-check> 692 | help="Two or more seed papers: work_id_int, W, DOI, or https://doi.org/...", treefmt-check> 693 | ), treefmt-check> 694 | types: list[str] = typer.Option( treefmt-check> | ________________________^ treefmt-check> 695 | | None, treefmt-check> 696 | | "--type", treefmt-check> 697 | | "-t", treefmt-check> 698 | | help="Bridge types to compute (default: all). " treefmt-check> 699 | | "Options: common_refs, common_citers, coupling, cocitation, path, ppr", treefmt-check> 700 | | ), treefmt-check> | |_____^ treefmt-check> 701 | limit: int = typer.Option(100, "--limit", "-n", help="Max results per type"), treefmt-check> 702 | max_neighbor_degree: int = typer.Option( treefmt-check> | treefmt-check> treefmt-check> PIE810 Call `startswith` once with a `tuple` treefmt-check> --> quarry/core/expand.py:211:8 treefmt-check> | treefmt-check> 210 | # DOI — normalize to OA format treefmt-check> 211 | if seed.startswith("10.") or seed.startswith("https://doi.org/"): treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 212 | doi = "https://doi.org/" + seed.removeprefix("https://doi.org/").lower() treefmt-check> 213 | with psycopg.connect(pg_conninfo) as conn, conn.cursor() as cur: treefmt-check> | treefmt-check> help: Merge into a single `startswith` call treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/core/expand.py:259:12 treefmt-check> | treefmt-check> 257 | result[row[0]] = entry treefmt-check> 258 | return result treefmt-check> 259 | except Exception: treefmt-check> | ^^^^^^^^^ treefmt-check> 260 | return {} treefmt-check> | treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> quarry/etl/embeddings.py:60:12 treefmt-check> | treefmt-check> 58 | def _ch_exec(query: str) -> str: treefmt-check> 59 | """Execute CH query, return stdout. Raises on error.""" treefmt-check> 60 | proc = subprocess.run( treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 61 | _ch_cmd() + ["--query", query], treefmt-check> 62 | capture_output=True, treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/etl/embeddings.py:335:16 treefmt-check> | treefmt-check> 333 | try: treefmt-check> 334 | _ch_exec(f"DROP TABLE IF EXISTS {table}") treefmt-check> 335 | except Exception as exc: treefmt-check> | ^^^^^^^^^ treefmt-check> 336 | logger.warning("Failed to drop %s: %s", table, exc) treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/etl/embeddings.py:352:12 treefmt-check> | treefmt-check> 350 | logger.info("Building work_id BTree index for hash lookups...") treefmt-check> 351 | lance.create_scalar_index("work_id") treefmt-check> 352 | except Exception: treefmt-check> | ^^^^^^^^^ treefmt-check> 353 | lance.create_table() treefmt-check> | treefmt-check> treefmt-check> SIM113 Use `enumerate()` for index variable `batch_num` in `for` loop treefmt-check> --> quarry/etl/embeddings.py:407:13 treefmt-check> | treefmt-check> 406 | total_encoded += len(to_encode) treefmt-check> 407 | batch_num += 1 treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 408 | throughput = len(texts) / elapsed if elapsed > 0 else 0 treefmt-check> | treefmt-check> treefmt-check> DTZ007 Naive datetime constructed using `datetime.datetime.strptime()` without %z treefmt-check> --> quarry/etl/fetch.py:68:29 treefmt-check> | treefmt-check> 66 | if modify: treefmt-check> 67 | try: treefmt-check> 68 | remote_ts = datetime.strptime(modify[:14], "%Y%m%d%H%M%S") treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 69 | local_ts = datetime.fromtimestamp(local_path.stat().st_mtime) treefmt-check> 70 | if remote_ts > local_ts: treefmt-check> | treefmt-check> help: Call `.replace(tzinfo=)` or `.astimezone()` to convert to an aware datetime treefmt-check> treefmt-check> DTZ006 `datetime.datetime.fromtimestamp()` called without a `tz` argument treefmt-check> --> quarry/etl/fetch.py:69:28 treefmt-check> | treefmt-check> 67 | try: treefmt-check> 68 | remote_ts = datetime.strptime(modify[:14], "%Y%m%d%H%M%S") treefmt-check> 69 | local_ts = datetime.fromtimestamp(local_path.stat().st_mtime) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 70 | if remote_ts > local_ts: treefmt-check> 71 | to_download.append(name) treefmt-check> | treefmt-check> help: Pass a `datetime.timezone` object to the `tz` parameter treefmt-check> treefmt-check> S110 `try`-`except`-`pass` detected, consider logging the exception treefmt-check> --> quarry/etl/fetch.py:121:29 treefmt-check> | treefmt-check> 119 | … try: treefmt-check> 120 | … conn.close() treefmt-check> 121 | / … except Exception: treefmt-check> 122 | | … pass treefmt-check> | |______________________________^ treefmt-check> 123 | … conn = ftplib.FTP(host, timeout=120) treefmt-check> 124 | … conn.login() treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/etl/fetch.py:121:36 treefmt-check> | treefmt-check> 119 | … try: treefmt-check> 120 | … conn.close() treefmt-check> 121 | … except Exception: treefmt-check> | ^^^^^^^^^ treefmt-check> 122 | … pass treefmt-check> 123 | … conn = ftplib.FTP(host, timeout=120) treefmt-check> | treefmt-check> treefmt-check> S110 `try`-`except`-`pass` detected, consider logging the exception treefmt-check> --> quarry/etl/fetch.py:128:13 treefmt-check> | treefmt-check> 126 | try: treefmt-check> 127 | conn.quit() treefmt-check> 128 | / except Exception: treefmt-check> 129 | | pass treefmt-check> | |____________________^ treefmt-check> 130 | return results treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/etl/fetch.py:128:20 treefmt-check> | treefmt-check> 126 | try: treefmt-check> 127 | conn.quit() treefmt-check> 128 | except Exception: treefmt-check> | ^^^^^^^^^ treefmt-check> 129 | pass treefmt-check> 130 | return results treefmt-check> | treefmt-check> treefmt-check> DTZ005 `datetime.datetime.now()` called without a `tz` argument treefmt-check> --> quarry/etl/fetch.py:189:15 treefmt-check> | treefmt-check> 188 | if dest.exists() and max_age_days is not None: treefmt-check> 189 | age = datetime.now() - datetime.fromtimestamp(dest.stat().st_mtime) treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 190 | if age < timedelta(days=max_age_days): treefmt-check> 191 | return {"status": "fresh", "path": str(dest), "bytes": dest.stat().st_size} treefmt-check> | treefmt-check> help: Pass a `datetime.timezone` object to the `tz` parameter treefmt-check> treefmt-check> DTZ006 `datetime.datetime.fromtimestamp()` called without a `tz` argument treefmt-check> --> quarry/etl/fetch.py:189:32 treefmt-check> | treefmt-check> 188 | if dest.exists() and max_age_days is not None: treefmt-check> 189 | age = datetime.now() - datetime.fromtimestamp(dest.stat().st_mtime) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 190 | if age < timedelta(days=max_age_days): treefmt-check> 191 | return {"status": "fresh", "path": str(dest), "bytes": dest.stat().st_size} treefmt-check> | treefmt-check> help: Pass a `datetime.timezone` object to the `tz` parameter treefmt-check> treefmt-check> DTZ005 `datetime.datetime.now()` called without a `tz` argument treefmt-check> --> quarry/etl/fetch.py:247:15 treefmt-check> | treefmt-check> 246 | if target.exists(): treefmt-check> 247 | age = datetime.now() - datetime.fromtimestamp(target.stat().st_mtime) treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 248 | if age < timedelta(days=max_age_days): treefmt-check> 249 | return { treefmt-check> | treefmt-check> help: Pass a `datetime.timezone` object to the `tz` parameter treefmt-check> treefmt-check> DTZ006 `datetime.datetime.fromtimestamp()` called without a `tz` argument treefmt-check> --> quarry/etl/fetch.py:247:32 treefmt-check> | treefmt-check> 246 | if target.exists(): treefmt-check> 247 | age = datetime.now() - datetime.fromtimestamp(target.stat().st_mtime) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 248 | if age < timedelta(days=max_age_days): treefmt-check> 249 | return { treefmt-check> | treefmt-check> help: Pass a `datetime.timezone` object to the `tz` parameter treefmt-check> treefmt-check> SIM117 Use a single `with` statement with multiple contexts instead of nested `with` statements treefmt-check> --> quarry/etl/fetch.py:259:5 treefmt-check> | treefmt-check> 258 | tmp_target = target.with_suffix(target.suffix + ".tmp") treefmt-check> 259 | / with zipfile.ZipFile(zip_path) as zf: treefmt-check> 260 | | # Extract only the expected file to a temp path treefmt-check> 261 | | with zf.open(expected_file) as src, open(tmp_target, "wb") as dst: treefmt-check> | |__________________________________________________________________________^ treefmt-check> 262 | while chunk := src.read(65536): treefmt-check> 263 | dst.write(chunk) treefmt-check> | treefmt-check> help: Combine `with` statements treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/fetch.py:109:12 treefmt-check> | treefmt-check> 107 | try: treefmt-check> 108 | tree = lxml_html.fromstring(html_bytes) treefmt-check> 109 | except Exception: treefmt-check> | ^^^^^^^^^ treefmt-check> 110 | return None treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/fetch.py:146:12 treefmt-check> | treefmt-check> 144 | p.remove(tag) treefmt-check> 145 | return " ".join(tree.text_content().split()) treefmt-check> 146 | except Exception: treefmt-check> | ^^^^^^^^^ treefmt-check> 147 | return "" treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/fetch.py:223:12 treefmt-check> | treefmt-check> 221 | result = converter.convert(stream) treefmt-check> 222 | return result.document.export_to_markdown() treefmt-check> 223 | except Exception: treefmt-check> | ^^^^^^^^^ treefmt-check> 224 | return "" treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/fetch.py:288:12 treefmt-check> | treefmt-check> 286 | result.layer = "FAIL" treefmt-check> 287 | treefmt-check> 288 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 289 | result.notes.append(f"error: {e}") treefmt-check> 290 | result.layer = "FAIL" treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/fetch.py:342:12 treefmt-check> | treefmt-check> 340 | result.notes.append(f"unexpected ct: {ct[:40]}") treefmt-check> 341 | treefmt-check> 342 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 343 | result.notes.append(f"error: {e}") treefmt-check> | treefmt-check> treefmt-check> S110 `try`-`except`-`pass` detected, consider logging the exception treefmt-check> --> quarry/fetch.py:381:21 treefmt-check> | treefmt-check> 379 | try: treefmt-check> 380 | pdf_data.append(await response.body()) treefmt-check> 381 | / except Exception: treefmt-check> 382 | | pass treefmt-check> | |____________________________^ treefmt-check> 383 | treefmt-check> 384 | page.on("response", intercept_pdf) treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/fetch.py:381:28 treefmt-check> | treefmt-check> 379 | try: treefmt-check> 380 | pdf_data.append(await response.body()) treefmt-check> 381 | except Exception: treefmt-check> | ^^^^^^^^^ treefmt-check> 382 | pass treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/fetch.py:429:20 treefmt-check> | treefmt-check> 427 | result.notes.append("no PDF found in rendered page") treefmt-check> 428 | treefmt-check> 429 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 430 | result.notes.append(f"navigation error: {e}") treefmt-check> 431 | finally: treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/fetch.py:434:12 treefmt-check> | treefmt-check> 432 | await browser.close() treefmt-check> 433 | treefmt-check> 434 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 435 | result.notes.append(f"L2 error: {e}") treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/fetch.py:475:12 treefmt-check> | treefmt-check> 473 | result.notes.append(f"text: {text[:60]!r}") treefmt-check> 474 | treefmt-check> 475 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 476 | result.layer = "FAIL" treefmt-check> 477 | result.notes.append(f"error: {e}") treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> quarry/fetch.py:551:12 treefmt-check> | treefmt-check> 549 | result.notes.append(f"unpaywall -> {oa_url[:70]}") treefmt-check> 550 | treefmt-check> 551 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 552 | result.layer = "FAIL" treefmt-check> 553 | result.notes.append(f"unpaywall error: {e}") treefmt-check> | treefmt-check> treefmt-check> SIM102 Use a single `if` statement instead of nested `if` statements treefmt-check> --> quarry/fetch.py:580:5 treefmt-check> | treefmt-check> 578 | # API — Zenodo treefmt-check> 579 | r_api = await _zenodo_api(url) treefmt-check> 580 | / if r_api is not None: treefmt-check> 581 | | if r_api.success: treefmt-check> | |_________________________^ treefmt-check> 582 | return r_api treefmt-check> 583 | # Recognized zenodo record but failed — fall through to L1 treefmt-check> | treefmt-check> help: Combine `if` statements using `and` treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> tests/integration/conftest.py:67:9 treefmt-check> | treefmt-check> 65 | """Run a command with logging.""" treefmt-check> 66 | logger.info(f"[{label}] {' '.join(cmd)}") treefmt-check> 67 | r = subprocess.run(cmd, capture_output=True, text=True) treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 68 | if r.stdout.strip(): treefmt-check> 69 | for line in r.stdout.strip().split("\n"): treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> tests/integration/conftest.py:164:5 treefmt-check> | treefmt-check> 162 | ) treefmt-check> 163 | # Kill any lingering clickhouse-client processes targeting quarry_test treefmt-check> 164 | subprocess.run( treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 165 | ["pkill", "-f", f"clickhouse-client.*{TEST_CH_DATABASE}"], treefmt-check> 166 | capture_output=True, treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> tests/integration/test_pipeline.py:276:13 treefmt-check> | treefmt-check> 274 | out_dir = PARSED_DIR / "oa" treefmt-check> 275 | out_dir.mkdir(parents=True, exist_ok=True) treefmt-check> 276 | r = subprocess.run( treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 277 | [ treefmt-check> 278 | "quarry-parse", treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> tests/integration/test_pipeline.py:295:13 treefmt-check> | treefmt-check> 293 | out_dir = PARSED_DIR / "pubmed" treefmt-check> 294 | out_dir.mkdir(parents=True, exist_ok=True) treefmt-check> 295 | r = subprocess.run( treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 296 | [ treefmt-check> 297 | "quarry-parse", treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> tests/integration/test_pipeline.py:315:13 treefmt-check> | treefmt-check> 313 | out_dir.mkdir(parents=True, exist_ok=True) treefmt-check> 314 | xml_path = DATA_DIR / "pubmed" / "mesh" / "desc_test.xml" treefmt-check> 315 | r = subprocess.run( treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 316 | [ treefmt-check> 317 | "quarry-parse", treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> tests/integration/test_pipeline.py:414:13 treefmt-check> | treefmt-check> 413 | # Verify PG has data treefmt-check> 414 | r = subprocess.run( treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 415 | ["psql", settings.pg_conninfo, "-t", "-c", "SELECT count(*) FROM works"], treefmt-check> 416 | capture_output=True, treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> tests/integration/test_pipeline.py:424:13 treefmt-check> | treefmt-check> 423 | # Verify join worked (works_export has PM/iCite enrichment) treefmt-check> 424 | r = subprocess.run( treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 425 | [ treefmt-check> 426 | "psql", treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> tests/integration/test_pipeline.py:453:17 treefmt-check> | treefmt-check> 451 | print("\n=== PG table summary ===") treefmt-check> 452 | for t in tables: treefmt-check> 453 | r = subprocess.run( treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 454 | ["psql", settings.pg_conninfo, "-t", "-c", f"SELECT count(*) FROM {t}"], treefmt-check> 455 | capture_output=True, treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> PLW1510 `subprocess.run` without explicit `check` argument treefmt-check> --> tests/unit/test_cli_features.py:17:12 treefmt-check> | treefmt-check> 15 | def _quarry(*args: str, timeout: int = 60) -> subprocess.CompletedProcess: treefmt-check> 16 | """Run quarry CLI command and return result.""" treefmt-check> 17 | return subprocess.run( treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 18 | ["quarry", *args], treefmt-check> 19 | capture_output=True, treefmt-check> | treefmt-check> help: Add explicit `check=False` treefmt-check> treefmt-check> Found 73 errors (21 fixed, 52 remaining). treefmt-check> No fixes available (8 hidden fixes can be enabled with the `--unsafe-fixes` option). treefmt-check> treefmt-check> traversed 171 files treefmt-check> emitted 140 files for processing treefmt-check> formatted 93 files (9 changed) in 515ms treefmt-check> Error: failed to finalise formatting: formatting failures detected error: Cannot build '/nix/store/zy05r89dg2hazv5nrx94r5k02a0skq0c-treefmt-check.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/d6dc1sr1jbqynrdyfbrkpkmpb7hjfqa8-treefmt-check Last 25 log lines: > | ^^^^^^^^^^^^^^ > 454 | ["psql", settings.pg_conninfo, "-t", "-c", f"SELECT count(*) FROM {t}"], > 455 | capture_output=True, > | > help: Add explicit `check=False` > > PLW1510 `subprocess.run` without explicit `check` argument > --> tests/unit/test_cli_features.py:17:12 > | > 15 | def _quarry(*args: str, timeout: int = 60) -> subprocess.CompletedProcess: > 16 | """Run quarry CLI command and return result.""" > 17 | return subprocess.run( > | ^^^^^^^^^^^^^^ > 18 | ["quarry", *args], > 19 | capture_output=True, > | > help: Add explicit `check=False` > > Found 73 errors (21 fixed, 52 remaining). > No fixes available (8 hidden fixes can be enabled with the `--unsafe-fixes` option). > > traversed 171 files > emitted 140 files for processing > formatted 93 files (9 changed) in 515ms > Error: failed to finalise formatting: formatting failures detected For full logs, run: nix log /nix/store/zy05r89dg2hazv5nrx94r5k02a0skq0c-treefmt-check.drv