Skip to content

Conversation

alanmcruickshank
Copy link
Member

There are a few corners of util which I couldn't find a tidier solution for - but this gets most of sqlfluff.utils up to strict mypy standard. I might change some of this later, but thought I should make the existing typing clearer first.

Copy link
Contributor

github-actions bot commented Sep 27, 2024

Coverage Results ✅

Name    Stmts   Miss  Cover   Missing
-------------------------------------
TOTAL   18362      0   100%

237 files skipped due to complete coverage.

@coveralls
Copy link

coveralls commented Sep 27, 2024

Coverage Status

coverage: 99.985%. remained the same
when pulling cfc49f1 on ac/util_strict_typing
into 0539c78 on main.

@@ -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)
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

@WittierDinosaur WittierDinosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alanmcruickshank alanmcruickshank added this pull request to the merge queue Sep 27, 2024
Merged via the queue into main with commit d69a511 Sep 27, 2024
29 checks passed
@alanmcruickshank alanmcruickshank deleted the ac/util_strict_typing branch September 27, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants