Skip to content

Commit

Permalink
🔧 Remove delete from needs.json
Browse files Browse the repository at this point in the history
The `:delete:` option on a need directive deletes a need before creating/storing it,
therefore it is literally impossible for it to be anything other than `False`.
  • Loading branch information
chrisjsewell committed Jan 27, 2025
1 parent 540a321 commit 5a1df85
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 107 deletions.
1 change: 1 addition & 0 deletions sphinx_needs/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class CoreFieldParameters(TypedDict):
"schema": {"type": "boolean", "default": False},
"exclude_external": True,
"exclude_import": True,
"exclude_json": True,
},
"layout": {
"description": "Key of the layout, which is used to render the need.",
Expand Down
2 changes: 1 addition & 1 deletion sphinx_needs/needs.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def load_config(app: Sphinx, *_args: Any) -> None:
if needs_config.report_dead_links is not True:
log_warning(
LOGGER,
'Config option "needs_constraints_failed_color" is deprecated. Please use `suppress_warnings = ["needs.link_outgoing"]` instead.',
'Config option "needs_report_dead_links" is deprecated. Please use `suppress_warnings = ["needs.link_outgoing"]` instead.',
"config",
None,
)
Expand Down
8 changes: 0 additions & 8 deletions tests/__snapshots__/test_basic_doc.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -88,7 +87,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -222,12 +220,6 @@
'field_type': 'extra',
'type': 'string',
}),
'delete': dict({
'default': False,
'description': 'If true, the need is deleted entirely.',
'field_type': 'core',
'type': 'boolean',
}),
'docname': dict({
'default': None,
'description': 'Name of the document where the need is defined (None if external).',
Expand Down
12 changes: 0 additions & 12 deletions tests/__snapshots__/test_external.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@
'field_type': 'extra',
'type': 'string',
}),
'delete': dict({
'default': False,
'description': 'If true, the need is deleted entirely.',
'field_type': 'core',
'type': 'boolean',
}),
'docname': dict({
'default': None,
'description': 'Name of the document where the need is defined (None if external).',
Expand Down Expand Up @@ -667,12 +661,6 @@
'field_type': 'extra',
'type': 'string',
}),
'delete': dict({
'default': False,
'description': 'If true, the need is deleted entirely.',
'field_type': 'core',
'type': 'boolean',
}),
'docname': dict({
'default': None,
'description': 'Name of the document where the need is defined (None if external).',
Expand Down
6 changes: 0 additions & 6 deletions tests/__snapshots__/test_extra_options.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@
'field_type': 'extra',
'type': 'string',
}),
'delete': dict({
'default': False,
'description': 'If true, the need is deleted entirely.',
'field_type': 'core',
'type': 'boolean',
}),
'docname': dict({
'default': None,
'description': 'Name of the document where the need is defined (None if external).',
Expand Down
14 changes: 0 additions & 14 deletions tests/__snapshots__/test_need_constraints.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
}),
'content': 'This is a requirement describing OPSEC processes.',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -94,7 +93,6 @@
}),
'content': 'Example of a successful constraint.',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -171,7 +169,6 @@
}),
'content': 'Example of a failed constraint.',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -246,7 +243,6 @@
}),
'content': 'Example of a failed constraint with medium severity. Note the style from :ref:`needs_constraint_failed_options`',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -316,7 +312,6 @@
}),
'content': 'The Tool awesome shall have a command line interface.',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -393,7 +388,6 @@
}),
'content': 'asdf',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -470,7 +464,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'style_test',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -544,7 +537,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'style_test',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -678,12 +670,6 @@
'field_type': 'extra',
'type': 'string',
}),
'delete': dict({
'default': False,
'description': 'If true, the need is deleted entirely.',
'field_type': 'core',
'type': 'boolean',
}),
'docname': dict({
'default': None,
'description': 'Name of the document where the need is defined (None if external).',
Expand Down
23 changes: 0 additions & 23 deletions tests/__snapshots__/test_needextend.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -91,7 +90,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -162,7 +160,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -233,7 +230,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -303,7 +299,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -438,12 +433,6 @@
'field_type': 'extra',
'type': 'string',
}),
'delete': dict({
'default': False,
'description': 'If true, the need is deleted entirely.',
'field_type': 'core',
'type': 'boolean',
}),
'docname': dict({
'default': None,
'description': 'Name of the document where the need is defined (None if external).',
Expand Down Expand Up @@ -820,7 +809,6 @@
Got an outgoing link ``extend_test_004``.
''',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -896,7 +884,6 @@
Got an incoming links ``extend_test_003`` and ``extend_test_006``.
''',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -972,7 +959,6 @@
Both got deleted.
''',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -1043,7 +1029,6 @@
}),
'content': 'Had the link ``extend_test_003``, got another one ``extend_test_004``.',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -1115,7 +1100,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -1188,7 +1172,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'page_1',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -1325,12 +1308,6 @@
'field_type': 'extra',
'type': 'string',
}),
'delete': dict({
'default': False,
'description': 'If true, the need is deleted entirely.',
'field_type': 'core',
'type': 'boolean',
}),
'docname': dict({
'default': None,
'description': 'Name of the document where the need is defined (None if external).',
Expand Down
6 changes: 0 additions & 6 deletions tests/__snapshots__/test_needimport.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -1714,12 +1714,6 @@
'field_type': 'extra',
'type': 'string',
}),
'delete': dict({
'default': False,
'description': 'If true, the need is deleted entirely.',
'field_type': 'core',
'type': 'boolean',
}),
'docname': dict({
'default': None,
'description': 'Name of the document where the need is defined (None if external).',
Expand Down
24 changes: 0 additions & 24 deletions tests/__snapshots__/test_needs_builder.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -88,7 +87,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -158,7 +156,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -293,12 +290,6 @@
'field_type': 'extra',
'type': 'string',
}),
'delete': dict({
'default': False,
'description': 'If true, the need is deleted entirely.',
'field_type': 'core',
'type': 'boolean',
}),
'docname': dict({
'default': None,
'description': 'Name of the document where the need is defined (None if external).',
Expand Down Expand Up @@ -954,12 +945,6 @@
'field_type': 'extra',
'type': 'string',
}),
'delete': dict({
'default': False,
'description': 'If true, the need is deleted entirely.',
'field_type': 'core',
'type': 'boolean',
}),
'docname': dict({
'default': None,
'description': 'Name of the document where the need is defined (None if external).',
Expand Down Expand Up @@ -1499,7 +1484,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -1569,7 +1553,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -1639,7 +1622,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -1774,12 +1756,6 @@
'field_type': 'extra',
'type': 'string',
}),
'delete': dict({
'default': False,
'description': 'If true, the need is deleted entirely.',
'field_type': 'core',
'type': 'boolean',
}),
'docname': dict({
'default': None,
'description': 'Name of the document where the need is defined (None if external).',
Expand Down
3 changes: 0 additions & 3 deletions tests/__snapshots__/test_needs_id_builder.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -99,7 +98,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down Expand Up @@ -179,7 +177,6 @@
}),
'content': '',
'created_at': '',
'delete': False,
'docname': 'index',
'doctype': '.rst',
'duration': '',
Expand Down
Loading

0 comments on commit 5a1df85

Please sign in to comment.