-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Use a StrEnum
to record linkcheck status codes
#13043
Use a StrEnum
to record linkcheck status codes
#13043
Conversation
sphinx/builders/linkcheck.py
Outdated
@@ -158,14 +172,14 @@ def process_result(self, result: CheckResult) -> None: | |||
red('broken ') + result.uri + red(' - ' + result.message) | |||
) | |||
self.write_entry( | |||
'broken', | |||
result.status, |
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.
result.status, | |
LinkStatus.BROKEN.value, |
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.
Using a specific symbol/status-code per write_entry
call makes sense to me; I'm less sure about the .value
access though. What's the thinking there?
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.
'broken'
is a literal, the closest semantic replacement is the LinkStatus.BROKEN.value
constant, rather than the result.status
variable.
StrEnum
for status codesStrEnum
to record status codes
StrEnum
to record status codesStrEnum
to record status codes
StrEnum
to record status codesStrEnum
to record linkcheck status codes
Thanks @AA-Turner! |
Feature or Bugfix
Purpose
linkcheck
builder.Detail
StrEnum
to declare the available hyperlink result status codes.Relates
Literal
#13040.