AllenNeuralDynamics / AllenNeuralDynamics/aind-flake8-extensions

Force developers to name paired unit fields properly

Offen
#4 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
0
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

# 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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.