formatting - What is the difference between the 'fix' and the 'format' commands in SQLFluff? - S

admin2025-04-18  3

It's not clear to me what is the difference between these two commands available in SQLFluff:

fix       Fix SQL files.
format    Autoformat SQL files.

What is the difference between the two commands?

It's not clear to me what is the difference between these two commands available in SQLFluff:

fix       Fix SQL files.
format    Autoformat SQL files.

What is the difference between the two commands?

Share edited Jan 29 at 18:07 jarlh 44.8k8 gold badges50 silver badges67 bronze badges asked Jan 29 at 17:05 Paul Razvan BergPaul Razvan Berg 21.7k13 gold badges88 silver badges133 bronze badges 1
  • I removed the <sql> tag since this isn't really an ISO/ANSI SQL related question. – jarlh Commented Jan 29 at 18:08
Add a comment  | 

1 Answer 1

Reset to default 1

From the docs:

format

Autoformat SQL files.

This effectively force applies sqlfluff fix with a known subset of fairly stable rules. Enabled rules are ignored, but rule exclusions (via CLI) or config are still respected.

So we see format is a reduced/simplified or less-aggressive version of fix. Though it's also possible the "effectively" weasel word here carries a lot of water.

转载请注明原文地址:http://anycun.com/QandA/1744950217a89914.html