We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When given a relative path and absolute path, sqlfmt fails with:
sqlfmt
$ sqlfmt data/models/foo.sql /Users/smcgivern/Code/linear-app/data/models/bar.sql Traceback (most recent call last): File "/Users/smcgivern/.asdf/installs/python/3.11.3/bin/sqlfmt", line 8, in <module> sys.exit(sqlfmt()) ^^^^^^^^ File "/Users/smcgivern/.asdf/installs/python/3.11.3/lib/python3.11/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/smcgivern/.asdf/installs/python/3.11.3/lib/python3.11/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Users/smcgivern/.asdf/installs/python/3.11.3/lib/python3.11/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/smcgivern/.asdf/installs/python/3.11.3/lib/python3.11/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/smcgivern/.asdf/installs/python/3.11.3/lib/python3.11/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/smcgivern/.asdf/installs/python/3.11.3/lib/python3.11/site-packages/sqlfmt/cli.py", line 176, in sqlfmt config = load_config_file(files) ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/smcgivern/.asdf/installs/python/3.11.3/lib/python3.11/site-packages/sqlfmt/config.py", line 23, in load_config_file common_parents = _get_common_parents(files) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/smcgivern/.asdf/installs/python/3.11.3/lib/python3.11/site-packages/sqlfmt/config.py", line 55, in _get_common_parents root_dir = max(common_parents, key=lambda p: p.parts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: max() arg is an empty sequence
To Reproduce
Run sqlfmt with two paths, one relative and one absolute.
Expected behavior
It doesn't crash 🙂 More precisely, it converts the relative path to an absolute one first.
Actual behavior
Crashes as above.
Additional context What is the output of sqlfmt --version?
sqlfmt --version
$ sqlfmt --version sqlfmt, version 0.18.1
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
When given a relative path and absolute path,
sqlfmt
fails with:To Reproduce
Run
sqlfmt
with two paths, one relative and one absolute.Expected behavior
It doesn't crash 🙂 More precisely, it converts the relative path to an absolute one first.
Actual behavior
Crashes as above.
Additional context
What is the output of
sqlfmt --version
?The text was updated successfully, but these errors were encountered: