sqlfmt icon indicating copy to clipboard operation
sqlfmt copied to clipboard

File counts unstable for dbt projects with --exclude

Open tconbeer opened this issue 2 years ago • 0 comments

Describe the bug I can't reliably repro this, but sometimes running sqlfmt on a dbt project produces the different numbers of files in the output:

(dbt-Jui2apcR-py3.8) tco@bros-gold:~/dbt/proj$ sqlfmt .
79 files left unchanged.
(dbt-Jui2apcR-py3.8) tco@bros-gold:~/dbt/proj$ sqlfmt .
53 files left unchanged.

This doesn't actually seem like it has anything to do with the cache, as adding -k to either invocation doesn't change things. It might be related to git operations somehow?

To Reproduce Not sure; create a dbt project, add a config file with the recommended excludes, and use sqlfmt a lot...

[tool.sqlfmt]
exclude=["target/**/*", "dbt_packages/**/*"]

Expected behavior The same count of files every time.

Actual behavior Randomly different counts, up to 2x the expected count of files.

Additional context What is the output of sqlfmt --version? v0.18.0, been happening for a few versions, though.

tconbeer avatar Apr 27 '23 20:04 tconbeer