Skip to content

fix: remove unnecessary type conversions and promote pyrefly rule to error - #40882

Open
divyanshus2404 wants to merge 1 commit into
langgenius:mainfrom
divyanshus2404:fix/remove-unnecessary-type-conversions
Open

fix: remove unnecessary type conversions and promote pyrefly rule to error#40882
divyanshus2404 wants to merge 1 commit into
langgenius:mainfrom
divyanshus2404:fix/remove-unnecessary-type-conversions

Conversation

@divyanshus2404

@divyanshus2404 divyanshus2404 commented Aug 17, 2026

Copy link
Copy Markdown

Summary

  • Remove 165 redundant type conversion calls (str(), int(), float(), bool(), bytes()) where the argument is already the target type
  • Promote the unnecessary-type-conversion pyrefly rule from "info" to "error" in api/pyproject.toml so CI catches future occurrences

Motivation

Closes #39947. These conversions are no-ops that add noise and can mask actual type issues. Promoting the rule to error prevents regression.

Changes

76 files changed, 162 insertions, 162 deletions — all mechanical removal of redundant wrappers like:

  • str(already_a_str)already_a_str
  • int(already_an_int)already_an_int
  • float(already_a_float)already_a_float
  • bool(already_a_bool)already_a_bool
  • bytes(already_bytes)already_bytes

Test plan

  • pyrefly check reports 0 unnecessary-type-conversion errors
  • CI passes

@divyanshus2404
divyanshus2404 requested a review from a team August 17, 2026 10:19
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. refactor labels Aug 17, 2026
…error

Remove 165 redundant type conversion calls (str(), int(), float(),
bool(), bytes()) where the argument is already the target type.
Promote the unnecessary-type-conversion pyrefly rule from info to
error so CI catches future occurrences.

Closes langgenius#39947
@divyanshus2404
divyanshus2404 force-pushed the fix/remove-unnecessary-type-conversions branch from e8ae06e to 34a60c6 Compare August 17, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clean away unnecessary-type-conversion

1 participant