Repository navigation
feat: add correctly spelled ExternalReferenceType.RFC_9116 - #1082
buzludeniz wants to merge 3 commits into
Conversation
`RFC_9166` misspells the RFC number of its value `rfc-9116`. Add `RFC_9116` as an alias of the same member, and keep `RFC_9166` as the canonical name so that nothing breaks. Signed-off-by: buzludeniz <denizalbania@gmail.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Documentation build overview
|
ExternalReferenceType.RFC_9116
jkowalleck
left a comment
There was a problem hiding this comment.
I like this non-breaking fix.
Could you fix some nitpicks i had?
| RELEASE_NOTES = 'release-notes' # Only supported in >= 1.4 | ||
| RFC_9166 = 'rfc-9116' # Only supported in >= 1.6 | ||
| RFC_9166 = 'rfc-9116' # Only supported in >= 1.6 -- misspelled name, kept for backwards compatibility | ||
| RFC_9116 = 'rfc-9116' # Only supported in >= 1.6 -- alias of `RFC_9166` under the correct RFC number |
There was a problem hiding this comment.
| RFC_9116 = 'rfc-9116' # Only supported in >= 1.6 -- alias of `RFC_9166` under the correct RFC number | |
| RFC_9116 = 'rfc-9116' # Only supported in >= 1.6 |
| RELEASE_NOTES = 'release-notes' # Only supported in >= 1.4 | ||
| RFC_9166 = 'rfc-9116' # Only supported in >= 1.6 | ||
| RFC_9166 = 'rfc-9116' # Only supported in >= 1.6 -- misspelled name, kept for backwards compatibility | ||
| RFC_9116 = 'rfc-9116' # Only supported in >= 1.6 -- alias of `RFC_9166` under the correct RFC number |
There was a problem hiding this comment.
please define RFC_9116 first, RFC_9166 second
| QUALITY_METRICS = 'quality-metrics' # Only supported in >= 1.5 | ||
| RELEASE_NOTES = 'release-notes' # Only supported in >= 1.4 | ||
| RFC_9166 = 'rfc-9116' # Only supported in >= 1.6 | ||
| RFC_9166 = 'rfc-9116' # Only supported in >= 1.6 -- misspelled name, kept for backwards compatibility |
There was a problem hiding this comment.
| RFC_9166 = 'rfc-9116' # Only supported in >= 1.6 -- misspelled name, kept for backwards compatibility | |
| RFC_9166 = 'rfc-9116' # Deprecated; use RFC_9116 instead. see https://github.com/CycloneDX/cyclonedx-python-lib/issues/1074 |
Make `RFC_9116` the canonical member and `RFC_9166` its deprecated alias, as asked in review. Both names still resolve to the same member, so existing code keeps working; the member's `name` is now `RFC_9116`. The enum snapshots build each URL from the member's name, so the `tests/RFC_9166` URL in them becomes `tests/RFC_9116`. Signed-off-by: Deniz Ikili <denizalbania@gmail.com>
|
@jkowalleck thanks for the review. Both changes are in cabc4b6: I put the deprecation comment on the line above The enum snapshot tests build each URL from the member's name, so 13 snapshot files changed from |
| RELEASE_NOTES = 'release-notes' # Only supported in >= 1.4 | ||
| RFC_9166 = 'rfc-9116' # Only supported in >= 1.6 | ||
| RFC_9116 = 'rfc-9116' # Only supported in >= 1.6 | ||
| # Deprecated; use RFC_9116 instead. see https://github.com/CycloneDX/cyclonedx-python-lib/issues/1074 |
There was a problem hiding this comment.
please put this behind RFC_9166
feel free to split it in multiple lines - like so
RFC_9166 = 'rfc-9116' # Deprecated; use RFC_9116 instead.
# see https://github.com/CycloneDX/cyclonedx-python-lib/issues/1074If this is still too long, just add a # noqa[E501] marker an the end of the line
There was a problem hiding this comment.
Done in 79cc298: the note is now behind RFC_9166, on one line with # noqa: E501. I tried the two-line version first, but flake8 flags the aligned second comment line (E114 and E116), so I went with the noqa marker.
Move the deprecation comment to the end of the `RFC_9166` line, as asked in review. The line is longer than flake8's 120 characters, so it carries `# noqa: E501`. A second comment line aligned under the first fails flake8's E114 and E116, so the note stays on one line. Signed-off-by: Deniz Ikili <denizalbania@gmail.com>
Description
ExternalReferenceType.RFC_9166holds the valuerfc-9116(thesecurity.txtRFC), but its name has the RFCnumber wrong. As noted in the issue, renaming the member would be a breaking change, so this PR adds the correct
name as an enum alias instead:
ExternalReferenceType.RFC_9116is the same member asRFC_9166: same value, the same object, and found byvalue (
ExternalReferenceType('rfc-9116')) and by name.RFC_9166stays the canonical name, so iteration,.name, serialization and thetest snapshots are unchanged.
RFC_9116. Making it the canonical name (and droppingRFC_9166) couldwait for the next major version.
_ExternalReferenceSerializationHelpernow usesRFC_9116.TestEnumExternalReferenceType.test_rfc_9116_is_alias_of_rfc_9166.The full test suite passes, and so do flake8, mypy, isort, bandit and deptry.
Resolves or fixes issue: #1074
AI Tool Disclosure
Claude CodeClaude Opus 5.5Find a small open issue and fix it without a breaking change; add a test; run the test suite and the linters. The change and this description were reviewed by me before submitting.Affirmation