Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Remove delete from needs.json #1347

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

chrisjsewell
Copy link
Member

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.

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`.
@chrisjsewell chrisjsewell requested a review from danwos November 1, 2024 02:29
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.96%. Comparing base (4e10030) to head (b304faa).
Report is 84 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1347      +/-   ##
==========================================
+ Coverage   86.87%   87.96%   +1.08%     
==========================================
  Files          56       60       +4     
  Lines        6532     7105     +573     
==========================================
+ Hits         5675     6250     +575     
+ Misses        857      855       -2     
Flag Coverage Δ
pytests 87.96% <100.00%> (+1.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@christopheseyler
Copy link
Contributor

That means a deleted requirement doesn't appear in the needs.json with the delete attribute set to true ?

@chrisjsewell
Copy link
Member Author

That means a deleted requirement doesn't appear in the needs.json with the delete attribute set to true ?

deleted items have never appeared in the needs.json; that is the purpose of the need directive delete option

maybe they do currently, if someone makes a "custom" needs.json outside of sphinx-needs and imports it in, but this also should not be allowed

@christopheseyler
Copy link
Contributor

That is quite wierd. I though the purpose of this :delete: directive is to mark a requirement as "removed" and therefore, it would be a good practice to add a rational to this "delete" and then, to ensure the ID is not used by a new requirement

@chrisjsewell
Copy link
Member Author

it would be a good practice to add a rational to this "delete" and then, to ensure the ID is not used by a new requirement

Quite possibly; I didn't add delete this is before my time, all I can tell you is the actual logic in the code 😅

If we want to ensure no other need is created with the same ID as one deleted, it would probably be better to keep track of these IDs separately.

@danwos
Copy link
Member

danwos commented Dec 16, 2024

That is quite wierd. I though the purpose of this :delete: directive is to mark a requirement as "removed" and therefore, it would be a good practice to add a rational to this "delete" and then, to ensure the ID is not used by a new requirement

No, the goal of :delete: is simply to remove it from the internal database, as it never got written down.
The main use case is variant handling, where two nearly identical need objects are defined with the same ID. But during the Sphinx build, only one is kept.
So having identical IDs in the sources is fine, as long as only one makes it to the final output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants