AllenNeuralDynamics / AllenNeuralDynamics/aind-flake8-extensions

Force developers to name paired unit fields properly

Đang mở
#4 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
0
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

# User story
This follows from this PR: https://github.com/AllenNeuralDynamics/aind-data-schema/pull/1122 which gives some context for how the _unit validator works in `aind-data-schema`. Going forward this will be an expectation for developers.

As a developer, I want to be warned if I mis-name units. E.g. if I make a unit called `variable_unit` and I don't put something called `variable` in my class, I should get a warning. Similarly if I put something called `variable_unit` and have several other fields called `something_variable` and `something_else_variable` I should get a warning that the `variable` label should be placed as a prefix (i.e. the user should have to name their fields variable_something and variable_something_else, which are matched with the variable_unit field).

An additional complication is Optional, whatever the variable is the unit should be as well.

# Acceptance criteria
- [ ] PF004 warning for paired variable/variable_unit
- [ ] PF005 warning for variable_*/variable_unit
- [ ] PF006 warning if variable/unit are not both required or both optional

# Sprint Ready Checklist
- [ ] 1. Acceptance criteria defined
- [ ] 2. Team understands acceptance criteria
- [ ] 3. Team has defined solution / steps to satisfy acceptance criteria
- [ ] 4. Acceptance criteria is verifiable / testable
- [ ] 5. External / 3rd Party dependencies identified
- [ ] 6. Ticket is prioritized and sized

# Notes
There may be other conditions that should get caught here, but all I can think of right now are these.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

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.