-
Notifications
You must be signed in to change notification settings - Fork 71
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
👌 Warn on unknown need keys in external/import sources #1316
Conversation
This PR centralises the declaration of what keys to omit from external/import sources, onto the `NeedsCoreFields`. It then also uses `NeedsCoreFields` to identify unknown keys, and emits a warning if any are found. --- One issue that was identified during this is the distinction of `title` vs `full_title`, whereby `title` is meant to be the potentially trimmed version of `full_title`. I think storing both fields is unnecessary and confusing; trimming of the title is a presentational issue that should be handled when necessary, not stored in the data. Also it is of note that the need directive pre-trims the title, leading to both `title` and `full_title` being trimmed
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1316 +/- ##
==========================================
+ Coverage 86.87% 87.88% +1.00%
==========================================
Files 56 60 +4
Lines 6532 7066 +534
==========================================
+ Hits 5675 6210 +535
+ Misses 857 856 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi! After upgrading from Sphinx to 4.1.0 from 3.0.0 i cannot build any more (Have Warnings treated as error on). The question is here for me why the keys should be unknown?
but these are valid "links" from
|
Hey @kreuzberger, the "name" of the link you mention above comes from the |
Ok. than i understand that the needs.json should not export those links "incoming" and "outgoing". Can i suppress this / avoid this? Or has this to be fixed? The json file is recreated newly on the build. |
ok, just saw the configuration flags for needs export and filtering. |
This PR centralises the declaration of what keys to omit from external/import sources, onto the
NeedsCoreFields
spec.It then also uses
NeedsCoreFields
to identify unknown keys, and emits a warning if any are found.Note, this could be breaking for existing builds, in that a warning may now be emitted,
but I decided not to put this under a "configuration flag", since users can simply choose to ignore it with
suppress_warnings
One issue that was identified during this is the distinction of
title
vsfull_title
, wherebytitle
is meant to be the potentially trimmed version offull_title
.I think storing both fields is unnecessary and confusing; trimming of the title is a presentational issue that should be handled when necessary, not stored in the data.
Also, it is of note that the need directive pre-trims the title, leading to both
title
andfull_title
being trimmed