-
-
Notifications
You must be signed in to change notification settings - Fork 873
Almost all of util
up to strict typing
#6263
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
Conversation
Coverage Results ✅
|
src/sqlfluff/rules/layout/LT05.py
Outdated
@@ -46,6 +46,7 @@ def _eval(self, context: RuleContext) -> List[LintResult]: | |||
# of the line is a comment). | |||
assert res.anchor | |||
assert res.anchor.pos_marker | |||
assert isinstance(res.anchor, RawSegment) |
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.
could this not be properly typed in LintResult?
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.
in LintResult
it's a BaseSegment
, which is true in general, but not for layout rules, where it will always be a RawSegment
. I'll add a note to explain that.
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
There are a few corners of
util
which I couldn't find a tidier solution for - but this gets most ofsqlfluff.utils
up to strict mypy standard. I might change some of this later, but thought I should make the existing typing clearer first.