Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Support multiple files from the CLI (support dir globs)

Đang mở
#109 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
45/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
ruby
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu tại lib/dead_end/cli.rb, khoảng các dòng 43-55, nơi CLI hiện đang xử lý các đầu vào, và theo dõi cách đường dẫn đầu tiên được chọn. Kiểm tra các đặc tả CLI và tích hợp hiện có về hành vi của đối số. Được xem là hoàn thành khi một lệnh như dead_end **/*.rb xử lý mọi tệp đã được mở rộng thay vì chỉ tệp đầu tiên.

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

Mô tả

Problem

To run this against multiple files developers want to run:

$ dead_end **/*.rb

This doesn't work today due to terminal globbing, which we don't yet support. What's happening when that command is run is that info isn't coming to dead_end. Your shell is expanding the input to be all files:

$ echo **/*.rb
lib/dead_end.rb lib/dead_end/around_block_scan.rb lib/dead_end/auto.rb lib/dead_end/block_expand.rb lib/dead_end/capture_code_context.rb lib/dead_end/clean_document.rb lib/dead_end/cli.rb lib/dead_end/code_block.rb lib/dead_end/code_frontier.rb lib/dead_end/code_line.rb lib/dead_end/code_search.rb lib/dead_end/display_code_with_line_numbers.rb lib/dead_end/display_invalid_blocks.rb lib/dead_end/explain_syntax.rb lib/dead_end/insertion_sort.rb lib/dead_end/left_right_lex_count.rb lib/dead_end/lex_all.rb lib/dead_end/lex_value.rb lib/dead_end/parse_blocks_from_indent_line.rb lib/dead_end/ripper_errors.rb lib/dead_end/version.rb spec/integration/dead_end_spec.rb spec/integration/exe_cli_spec.rb spec/integration/ruby_command_line_spec.rb spec/spec_helper.rb spec/unit/around_block_scan_spec.rb spec/unit/block_expand_spec.rb spec/unit/capture_code_context_spec.rb spec/unit/clean_document_spec.rb spec/unit/cli_spec.rb spec/unit/code_block_spec.rb spec/unit/code_frontier_spec.rb spec/unit/code_line_spec.rb spec/unit/code_search_spec.rb spec/unit/display_invalid_blocks_spec.rb spec/unit/explain_syntax_spec.rb spec/unit/insertion_sort_spec.rb spec/unit/lex_all_spec.rb

So what's really happening when you run that dead_end **/*.rb command (I think) is that we're only looking at the first file in the list. i.e. calling this:

$ dead_end **/*.rb

Is functionally the same as calling:

$ dead_end lib/dead_end.rb # based on the file output from above

That's the problem.

Solution

The fix would be pretty easy, which would be to look at all inputs rather than just the first one. Essentially change this in the CLI to loop over all args, https://github.com/zombocom/dead_end/blob/e8eb54c651bfa196fc933f76def5d811bb5d57dc/lib/dead_end/cli.rb#L43-L55

Ngôn ngữ chính
Ruby
Star
350
Fork
17
Merge trung bình
48 phút
Pull request đã merge (30 ngày)
5

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

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 ruby/syntax_suggest

Tất cả issue của ruby/syntax_suggest

Issue tương tự

Thêm issue về Ruby

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.