Enable typechecking for several files including filepaths.py#1272
Merged
Conversation
e5f9f40 to
27647cd
Compare
filepaths.pyfilepaths.py
amjith
approved these changes
Jul 19, 2025
add type annotations for * mycli/__init__.py * mycli/compat.py * mycli/lexer.py * mycli/packages/filepaths.py * mycli/packages/hybrid_redirection.py * mycli/packages/parseutils.py * mycli/packages/special/delimitercommand.py * mycli/packages/toolkit/fzf.py * mycli/packages/toolkit/history.py * mycli/packages/special/favoritequeries.py * mycli/packages/special/utils.py * mycli/packages/tabular_output/sql_format.py and enable mypy checking for them in CI. Convert capitalized types in toolkit/history.py to modern annotations. Fix an int() cast on an env variable in test/utils.py, without enabling typecheck for the entire file. Make query_starts_with() and queries_starts_with() take a list rather than a tuple for the second argument. Fix a bug where extract_tables_from_complete_statements could crash without checking for a None. Fix a bug where table_format was not checked for None before treating as a string. Move __main__ section of parseutils.py to bottom of file. Consider removing it. Remove a needless inherit from "object". Convert an if/elif to the guard clause pattern.
27647cd to
514b898
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add type annotations for
mycli/__init__.pymycli/compat.pymycli/lexer.pymycli/packages/filepaths.pymycli/packages/hybrid_redirection.pymycli/packages/parseutils.pymycli/packages/special/delimitercommand.pymycli/packages/toolkit/fzf.pymycli/packages/toolkit/history.pymycli/packages/special/favoritequeries.pymycli/packages/special/utils.pymycli/packages/tabular_output/sql_format.pyand enable mypy checking for them in CI.
Convert capitalized types in
toolkit/history.pyto modern annotations.Fix an
int()cast on an env variable intest/utils.py, without enabling typecheck for the entire file.Make
query_starts_with()andqueries_starts_with() take a list rather than a tuple for the second argument.Fix a bug where
extract_tables_from_complete_statements()could crash without checking for aNone.Fix a bug where
table_formatwas not checked forNonebefore treating as a string.Move
__main__section ofparseutils.pyto bottom of file. Consider removing it.Remove a needless inherit from
object.Convert an if/elif to the guard clause pattern.
Checklist
changelog.md.AUTHORSfile (or it's already there).