Skip to content

chore: fix pre-existing pre-commit failures#68

Merged
dreamiurg merged 3 commits intodreamiurg:mainfrom
jag426:fix/pre-commit-ty-errors
Apr 1, 2026
Merged

chore: fix pre-existing pre-commit failures#68
dreamiurg merged 3 commits intodreamiurg:mainfrom
jag426:fix/pre-commit-ty-errors

Conversation

@jag426
Copy link
Copy Markdown
Contributor

@jag426 jag426 commented Mar 9, 2026

Summary

  • ty: Removed 29 now-unused # type: ignore comments (updated BS4 type stubs no longer need them), fixed two real type errors in models.py and scraper.py
  • yamllint: Added required second space before inline # vN pin comments across all 4 workflow files; broke a 151-char line in dependabot-auto-merge.yml into a $BODY variable

Test plan

  • uv run pre-commit run --all-files passes all hooks
  • uv run pytest — 141 passed, 3 skipped

🤖 Generated with Claude Code

Fix ty type checker errors and warnings:
- Remove 29 now-unused type: ignore comments across scraper.py,
  examples, and tests (ty updated its BS4 type stubs)
- Fix invalid-assignment in models.py by annotating trip_report
  as dict[str, Any] before mutating it
- Fix str | AttributeValueList assignment in scraper.py by casting
  url_link["href"] to str()

Fix yamllint warnings and errors in workflow files:
- Add required second space before inline # comments in ci.yml,
  release.yml, scorecard.yml, and codeql.yml
- Break long comment string in dependabot-auto-merge.yml into a
  $BODY variable to stay under the 120-char line limit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fc1cf866-143d-437e-bda1-fb0d6c13939d

📥 Commits

Reviewing files that changed from the base of the PR and between ae440cf and 75d312a.

📒 Files selected for processing (1)
  • peakbagger/scraper.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • peakbagger/scraper.py

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved JSON parsing and error handling in data-fetching paths.
  • Chores

    • Formatting-only updates to CI/CD workflows.
    • Removed type-ignore annotations and tightened type safety across the codebase.
    • Internal refactor of how nested data structures are constructed.

Walkthrough

Formatting and typing cleanup across CI workflows, examples, core scraper/models, and tests: removed several # type: ignore annotations, tightened local typing, minor refactors in trip_report construction, and a small workflow PR-body extraction change. No public API changes.

Changes

Cohort / File(s) Summary
GitHub Workflows — Formatting
\.github/workflows/ci.yml, \.github/workflows/codeql.yml, \.github/workflows/release.yml, \.github/workflows/scorecard.yml
Whitespace and inline-comment spacing adjustments on uses/step lines; no action/version/flow changes.
GitHub Workflows — PR body refactor
\.github/workflows/dependabot-auto-merge.yml
Composes the major-update message into a shell variable and passes it to gh pr comment instead of an inline literal; behavior unchanged.
Examples — JSON parsing typing
examples/batch_peaks.py, examples/export_csv.py
Removed type: ignore from JSON parsing returns; batch_peaks.py adds JSONDecodeError handling and returns None on parse failure.
Core — Typing cleanup
peakbagger/scraper.py, tests/test_statistics.py
Removed several # type: ignore[...] annotations and tightened local casts (e.g., explicit str() for href). No parsing/control-flow changes.
Core — trip_report construction
peakbagger/models.py
Refactored to_dict methods to build trip_report via a local dict[str, Any] and assign once after populating optional fields; semantics unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: fix pre-existing pre-commit failures' directly describes the main purpose of the pull request—fixing pre-commit tool failures related to type checking and YAML linting.
Description check ✅ Passed The description covers the main changes (type-ignore removals and type fixes, yamllint formatting) and test results, but the PR template checkbox for change type is not filled in.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dreamiurg
Copy link
Copy Markdown
Owner

@jag426 I appreciate your contributions! Apologies for the late merge. I have not noticed the PRs on this repo for a while.

@dreamiurg dreamiurg enabled auto-merge (squash) April 1, 2026 18:00
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.14%. Comparing base (6e4f918) to head (ac97722).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
peakbagger/models.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #68   +/-   ##
=======================================
  Coverage   92.13%   92.14%           
=======================================
  Files           9        9           
  Lines        1119     1120    +1     
=======================================
+ Hits         1031     1032    +1     
  Misses         88       88           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dreamiurg dreamiurg merged commit 84a82e3 into dreamiurg:main Apr 1, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants