-
Notifications
You must be signed in to change notification settings - Fork 5
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
Docs: Clean-up docstrings for wildcard query methods and classes introduced in #62. #63
Conversation
clp_ffi_py/wildcard_query.py
Outdated
" should not be used directly. To create a wildcard query, please explicit instantiate" | ||
" `clp_ffi_py.wildcard_query.SubstringWildcardQuery` or" | ||
" `clp_ffi_py.wildcard_query.FullStringWildcardQuery`.", | ||
reason=":class:`~clp_ffi_py.wildcard_query.WildcardQuery` is supposed to be an abstract" |
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.
While we're on the topic, I think it's worth improving the docstrings in this file.
WildcardQuery
:
An abstract class defining a wildcard query. Users should instantiate a
wildcard query through :class:`SubstringWildcardQuery` or
:class:`FullStringWildcardQuery`.
A wildcard string may contain the following types of wildcards:
1. '*': match 0 or more characters.
2. '?': match any single character.
Each wildcard can be escaped using a preceding '\\\\' (a single backslash).
Other characters that are escaped are treated as normal characters.
WildcardQuery().__init__.deprecated
:
reason=":class:`WildcardQuery` will soon be made abstract and should"
" not be used directly. To create a wildcard query, instead use"
" :class:`SubstringWildcardQuery` or :class:`FullStringWildcardQuery`."
SubstringWildcardQuery
:
A wildcard query that can match a substring in a log event's message, in
contrast with :class:`FullStringWildcardQuery` where the needs to match the
entire message.
This class is derived from :class:`WildcardQuery` by adding both a prefix
and a postfix wildcard ("*") to the input wildcard string.
FullStringWildcardQuery
:
A wildcard query where the query must match the entirety of the log event's
message, in contrast with :class:`SubstringWildcardQuery` where the query
only needs to match a substring.
This class is derived from :class:`WildcardQuery` as a more explicit
interface for full-string matches.
Users can create a match that's anchored to only one end of the message by
adding a prefix OR postfix wildcard ("*").
All case_sensitive
params:
:param case_sensitive: Whether to perform case-sensitive matching.
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.
make sense. Pushed
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.
For the PR title, how about:
Docs: Clean-up docstrings for wildcard query methods and classes introduced in #62.
lgtm |
References
Description
The docstrings in the new methods and classes introduced in #62 were not properly rendered in the doc webpage. There are two problems to solve:
FullStringWildcardQuery
's init function, otherwise, Sphinx will use the base class init, which is marked asdeprecated
in this case.Validation performed
Build the site locally and ensure it is rendered as expected.
For
add_wildcard_query
:For
FullStringWildcardQuery
: