Proposal for handling additional file inclusions/exclusions
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start by reading the existing model discovery and related-file expansion code, plus the configuration and tests for the exclusion options discussed in PRs #267 and #300. The issue proposes two alternative designs but does not choose one or identify files to change. Done means a chosen design is implemented and tested for model filtering and related-file exclusions.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I have been thinking through this and the other issues. In the end, it would be great to move away from option flags towards an explicit structure for controlling what does and does not get annotated. Do let me know what you think. Note: I used AI to create the proposals. (Moved this from #300)
How I think the ideal pipeline could be:
The Pipeline
1. Model discovery → scan model_dir globs, find candidate .rb files
2. Model filter → whitelist OR exclusion (mutually exclusive) — PRs #267 and #300
↓ surviving models
3. Related file → per model, expand to related files via patterns
expansion (additional_file_patterns, test/fixture/factory patterns, etc.)
↓ combined set: models + related files
4. Related file → additional exclusions for step 3, for example if you want to exclude annotating tests for a specific model
filtering
↓ final set to annotate
These are two options for handling exclusion
Option A — Unified Exclusion
A single exclude_patterns option operates on the combined set (models + related files) after expansion. (This would happen at step 4)
# .annotaterb.yml
exclude_patterns:
- "**/*.spec.rb" # prevents spec files from being treated as models
- "spec/billing/**/*" # prevents billing-related specs from being annotated
How it works:
- Model discovery finds all candidate files
- Model-level whitelist or exclusion is applied (PRs #267/#300)
- Related files are expanded per model
exclude_patternsis applied to the combined set — any file matching a pattern is dropped
Pros:
- Single concept and single config key — easy to explain and document
- Consistent: the same mechanism handles both model-level and related-file-level exclusion
- Familiar — similar to
.gitignoresemantics
Cons:
- Loses the distinction between "don't treat this as a model" and "don't annotate this related file" — both collapse into "don't touch this file"
- A pattern intended to exclude related files could unintentionally also exclude model files if written broadly
- Less explicit about which layer is being targeted
Option B — Separate Exclusion Options
Two distinct options target different layers of the pipeline explicitly.
# .annotaterb.yml
# Affects model discovery only — prevents files from being loaded as models
exclude_model_patterns:
- "**/*.spec.rb"
# Affects related file annotation only — models are still processed, but
# matching related files are skipped
exclude_related_file_patterns:
- "spec/billing/**/*"
How it works:
- Model discovery finds all candidate files
exclude_model_patternsis applied — matching files are dropped before any model loading- Related files are expanded per surviving model
exclude_related_file_patternsis applied to the related file set only
Pros:
- Explicit — the user knows exactly which layer they are targeting
exclude_model_patternscleanly handles PR #267 (.spec.rbfiles in model directories)exclude_related_file_patternscleanly complements the existingexclude_*boolean flags with pattern-based control- No risk of a related-file pattern accidentally excluding a model file
Cons:
- Two options to learn and document instead of one
- User must understand the distinction between model discovery and related file annotation to use correctly
- Slightly more config verbosity
- Ngôn ngữ chính
- Ruby
- Star
- 624
- Fork
- 95
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của drwl/annotaterb
-
additional_file_patterns no longer matches files outside empty root_dirCó thể đã có người làm @Shaisolaris đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
drwl/annotaterb#406 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`v4.25.0`: enum columns declared with a Rails-side `default:` still annotate the raw value instead of the labelCó thể đã có người làm @xanagi đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 62/100
drwl/annotaterb#408 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`annotaterb models --delete` doesn't remove annotations from files excluded via `exclude_*`Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
drwl/annotaterb#340 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
drwl/annotaterb#323 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Improve Documentation for YAML and CLI OptionsCó thể làm lại được @OdenTakashi đã nhận 193 ngày trước và không có pull request nào đang mở. Đang mở
drwl/annotaterb#312 · 8 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của drwl/annotaterb
Issue tương tự
-
agent:triaged bug bughunt pm:bundler priority:p1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
SocketDev/socket-patch#1573 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug chat verified
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 6 ngày
-
🐞 bug pending triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
CircuitVerse/CircuitVerse#8031 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BazaRb::Fake#enter rejects dotted badges accepted by BazaRb#enterCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
riscv/riscv-unified-db#2740 ·
Maintainer thường phản hồi trong vòng 1 ngày