Description
needs_constraints
and needs_warnings
(and to a lesser extent need_statuses and need_tags) are very similar in their function:
prohibit/warn about problematic needs
It is unclear to me why there needs to be two concepts for this, I feel that it is possible they could be merged and essentially warnings
are a sub-set of constraints that apply to all needs (as opposed to usually constraint "sets" are specified by the need).
At a minimum, this functionality should be expanded on in: https://sphinx-needs.readthedocs.io/en/latest/tutorial.html#enforcing-valid-need-items
It is also of note that for both of these concepts, more complex checks involving all needs have been requested: #1217, #1238, which neither currently support directly.
It is of note that, if warnings were merged with constraints (or called at the same time), AND we improve the detection of need modifications, these may not need to be re-computed for every re-build (as is the case now)
One note-to-self here is that possibly the needs should be "sealed" before checking for constraints here:
sphinx-needs/sphinx_needs/directives/need.py
Line 301 in 4120c18
then constraints/warnings would be processed, allowing for access to the immutable
NeedsView
, and then the constraints_
fields would be updated as a "special exception" to sealing the needs