delta-misuse flags absolute position/rotation assignments in _process

Đang mở Phù hợp với người mới
#107 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
testing-qa

Hướng nghiên cứu

Đọc src/lint/rules/delta-misuse.ts quanh các dòng 101–105 và so sánh nhánh thông tin vị trí/định hướng với nhánh vận tốc được mô tả trong issue. Chạy trường hợp tái hiện lỗi và các bài kiểm thử liên quan trong test/rules.test.ts bằng npm run build && npm test. Hoàn thành khi các phép gán tuyệt đối đơn giản không tạo ra phát hiện nào, còn position += speed trong _process vẫn được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug good first issue severity: low

Summary

delta-misuse reports the info "motion becomes frame-rate dependent" for plain absolute assignments in _process, such as position = get_global_mouse_position() or rotation = 0.0. These do not accumulate per frame, so they are not frame-rate dependent.

Where

  • src/lint/rules/delta-misuse.ts:101-105 (the info branch does not check stmt.type or self-reference)

Details

The velocity branch was tightened in 5d49f5d..e836036 (stmt.type === "assignment" plus a no-self-reference check), but the position/rotation info branch treats any = as an incremental change.

Steps to reproduce

func _process(delta):
    position = get_global_mouse_position()
    rotation = 0.0

gdcorrect lint reports two INFO delta-misuse findings.

Impact

Noise on very common code, which fails runs that use --fail-on info.

Suggested fix

Only flag augmented_assignment (+=, -=), or = where the right-hand side references the target itself (position = position + v).

Acceptance criteria

  • The repro reports nothing.
  • position += speed in _process (no delta) still reports.

Getting started

  • Relevant files: src/lint/rules/delta-misuse.ts, test/rules.test.ts
  • How to run tests: npm run build && npm test

Filed by repo-audit/full-audit at e836036. Severity: low. Effort: S. audit-key: bug|src/lint/rules/delta-misuse.ts|deltaMisuse

Ngôn ngữ chính
TypeScript
Star
0
Fork
6
Merge trung bình
1 ngày 21 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/godot-correctness-mcp

Tất cả issue của TMHSDigital/godot-correctness-mcp

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.