sqlfluff fix [filepaths...]

Fix SQL files

Arguments

NameDescription
filepathsfilepaths

Options

NameDescription
--nocolor, -nNo color - output will be without ANSI color codes
--ignore, -i <errors>Ignore particular families of errors so that they don’t cause a failed run. -–ignore behaves somewhat like noqa comments, except it applies globally
--verbose, -v
  • Repeatable ♾
  • Repeatable 5x
--exclude-rules, -e <exclude_rules>Exclude specific rules. This could either be the allowlist, or the general set if there is no specific allowlist
--rules, -r <rules>Narrow the search to only specific rules
--templater, -t <templater>The templater to use (default=jinja)
--dialect, -d <dialect>The dialect of SQL to lint
--format, -f <format>What format to return the lint result in (default=human)
--processes, -p <processes>The number of parallel processes to run. Positive numbers work as expected. Zero and negative numbers will work as number_of_cpus - number. e.g -1 means all cpus except one. 0 means all cpus
--fixed-suffix, -x <fixed_suffix>An optional suffix to add to fixed files
--disable-noqaSet this flag to ignore inline noqa comments
--benchSet this flag to engage the benchmarking tool output
--logger <logger>Choose to limit the logging to one of the loggers
--encoding <encoding>Specify encoding to use when reading and writing files. Defaults to autodetect
--ignore-local-configIgnore config files in default search path locations. This option allows the user to lint with the default config or can be used in conjunction with –config to only reference the custom config file
--config <extra_config_path>Include additional config file. By default the config is generated from the standard configuration files described in the documentation. This argument allows you to specify an additional configuration file that overrides the standard configuration files. N.B. cfg format is required
--write-output <write_output>Optionally provide a filename to write the results to, mostly used in tandem with –format. NB: Setting an output file re-enables normal stdout logging
--disable-progress-barDisables progress bars
--FIX-EVEN-UNPARSABLEEnables fixing of files that have templating or parse errors
--show-lint-violationsShow lint violations