id = "sqlfluff" name = "SQLFluff" homepage = "https://sqlfluff.com" description = "SQLFluff is a dialect-flexible and configurable SQL linter, designed with ELT applications in mind and working with Jinja and dbt." # The brush mark SQLFluff uses as its documentation favicon; the full # logo is a wordmark that reads as a smudge at icon size. icon = "https://docs.sqlfluff.com/en/stable/_static/favicon-fluff.png" executables = ["sqlfluff"] [dotfiles] # https://docs.sqlfluff.com/en/stable/configuration/setting_configuration.html # ("Nesting"): step 1 is "the user's os-specific app config directory. On macOS # and Unix this is ~/.config/sqlfluff, Windows is \AppData\Local\sqlfluff\ # sqlfluff"; step 2 is "the same files in the user's home directory (~)". # # Which directory macOS gets is decided in src/sqlfluff/core/config/loader.py, # `_get_user_config_dir_path`: on darwin it uses the Unix path when it already # exists and otherwise falls back to platformdirs' macOS location, # ~/Library/Application Support/sqlfluff. Both are listed. # # Of the five file names SQLFluff looks for in each location — setup.cfg, # tox.ini, pep8.ini, .sqlfluff, pyproject.toml — only `.sqlfluff` is # unambiguously SQLFluff's. Claiming ~/setup.cfg or ~/pyproject.toml would # claim files that belong to whatever else put them there. paths = [ "~/.sqlfluff", "~/.config/sqlfluff/.sqlfluff", "~/Library/Application Support/sqlfluff/.sqlfluff", "%LOCALAPPDATA%/sqlfluff/sqlfluff/.sqlfluff", ] exclude = [] # A .sqlfluff is dialect, rule and templater settings. Warehouse credentials # for the dbt templater live in dbt's own profiles.yml, not here. secret = [] # Read once per invocation; sqlfluff exits when it is done linting. side_effect = false # No machine_lines: dialect, line length, capitalisation policy and the rule # allow-list are exactly the preferences a user wants to follow them. [commands] format = 1 label = "SQL linter" description = "Lint or auto-fix SQL files. Parse, rules and dialects listing commands are left out." quality = "ai-draft" base = "fig:sqlfluff" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/sqlfluff.ts" license = "MIT" [[commands.subcommand]] path = ["lint"] label = "Lint SQL" description = "Report style and syntax violations in SQL files." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/sqlfluff.ts" license = "MIT" [[commands.subcommand.field]] id = "files" label = "Files or directories" type = "path" description = "SQL files or directories; leave empty to read stdin." multiple = true position = 0 path = { kind = "any", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "dialect" label = "Dialect" type = "string" option = ["--dialect", "-d"] description = "SQL dialect, e.g. ansi, postgres, bigquery." suggestions = [{ value = "ansi", label = "ansi" }, { value = "bigquery", label = "bigquery" }, { value = "hive", label = "hive" }, { value = "mysql", label = "mysql" }, { value = "oracle", label = "oracle" }, { value = "postgres", label = "postgres" }, { value = "redshift", label = "redshift" }, { value = "snowflake", label = "snowflake" }, { value = "spark3", label = "spark3" }, { value = "teradata", label = "teradata" }] sources = ["fig"] [[commands.subcommand.field]] id = "rules" label = "Only these rules" type = "string" option = ["--rules", "-r"] description = "Narrow the run to specific rules." sources = ["fig"] [[commands.subcommand.field]] id = "exclude_rules" label = "Exclude rules" type = "string" option = ["--exclude-rules", "-e"] description = "Exclude specific rules." sources = ["fig"] [[commands.subcommand.field]] id = "templater" label = "Templater" type = "string" option = ["--templater", "-t"] description = "The templater to use (default jinja)." suggestions = [{ value = "raw", label = "raw" }, { value = "jinja", label = "jinja" }, { value = "python", label = "python" }, { value = "placeholders", label = "placeholders" }] sources = ["fig"] [[commands.subcommand.field]] id = "format" label = "Output format" type = "enum" option = ["--format", "-f"] description = "Format for the results." choices = [{ value = "human", label = "human" }, { value = "json", label = "json" }, { value = "yaml", label = "yaml" }, { value = "github-annotation", label = "github-annotation" }, { value = "github-annotation-native", label = "github-annotation-native" }] sources = ["fig"] [[commands.subcommand.field]] id = "config" label = "Extra config file" type = "path" option = ["--config"] description = "Include an additional config file." path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "nocolor" label = "No color" type = "boolean" option = ["--nocolor", "-n"] description = "Output without ANSI color codes." sources = ["fig"] [[commands.subcommand.field]] id = "verbose" label = "Verbosity" type = "count" option = ["--verbose", "-v"] description = "Stackable verbosity." sources = ["fig"] [[commands.subcommand.field]] id = "nofail" label = "Always exit 0" type = "boolean" option = ["--nofail"] description = "Exit code is zero regardless of violations." sources = ["fig"] [[commands.subcommand.task]] id = "lint" label = "Lint files" fields = ["files", "dialect", "rules", "exclude_rules", "format"] required = ["dialect"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["files", "dialect", "rules", "exclude_rules", "format"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["templater", "config", "nocolor", "verbose", "nofail"] [[commands.subcommand]] path = ["fix"] label = "Fix SQL" description = "Rewrite SQL files in place to resolve fixable violations." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/sqlfluff.ts" license = "MIT" [[commands.subcommand.field]] id = "files" label = "Files or directories" type = "path" description = "SQL files or directories; leave empty to read stdin." multiple = true position = 0 path = { kind = "any", role = "input" } effect = "overwrite" sources = ["fig"] [[commands.subcommand.field]] id = "dialect" label = "Dialect" type = "string" option = ["--dialect", "-d"] description = "SQL dialect, e.g. ansi, postgres, bigquery." suggestions = [{ value = "ansi", label = "ansi" }, { value = "bigquery", label = "bigquery" }, { value = "hive", label = "hive" }, { value = "mysql", label = "mysql" }, { value = "oracle", label = "oracle" }, { value = "postgres", label = "postgres" }, { value = "redshift", label = "redshift" }, { value = "snowflake", label = "snowflake" }, { value = "spark3", label = "spark3" }, { value = "teradata", label = "teradata" }] sources = ["fig"] [[commands.subcommand.field]] id = "rules" label = "Only these rules" type = "string" option = ["--rules", "-r"] description = "Narrow the run to specific rules." sources = ["fig"] [[commands.subcommand.field]] id = "exclude_rules" label = "Exclude rules" type = "string" option = ["--exclude-rules", "-e"] description = "Exclude specific rules." sources = ["fig"] [[commands.subcommand.field]] id = "templater" label = "Templater" type = "string" option = ["--templater", "-t"] description = "The templater to use (default jinja)." suggestions = [{ value = "raw", label = "raw" }, { value = "jinja", label = "jinja" }, { value = "python", label = "python" }, { value = "placeholders", label = "placeholders" }] sources = ["fig"] [[commands.subcommand.field]] id = "format" label = "Output format" type = "enum" option = ["--format", "-f"] description = "Format for the results." choices = [{ value = "human", label = "human" }, { value = "json", label = "json" }, { value = "yaml", label = "yaml" }, { value = "github-annotation", label = "github-annotation" }, { value = "github-annotation-native", label = "github-annotation-native" }] sources = ["fig"] [[commands.subcommand.field]] id = "config" label = "Extra config file" type = "path" option = ["--config"] description = "Include an additional config file." path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "nocolor" label = "No color" type = "boolean" option = ["--nocolor", "-n"] description = "Output without ANSI color codes." sources = ["fig"] [[commands.subcommand.field]] id = "verbose" label = "Verbosity" type = "count" option = ["--verbose", "-v"] description = "Stackable verbosity." sources = ["fig"] [[commands.subcommand.field]] id = "fixed_suffix" label = "Suffix for fixed files" type = "string" option = ["--fixed-suffix", "-x"] description = "Optional suffix to add to fixed files." sources = ["fig"] [[commands.subcommand.field]] id = "show_lint" label = "Show lint violations" type = "boolean" option = ["--show-lint-violations"] description = "Show lint violations." sources = ["fig"] [[commands.subcommand.task]] id = "fix" label = "Fix files" fields = ["files", "dialect", "rules", "exclude_rules"] required = ["dialect", "files"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["files", "dialect", "rules", "exclude_rules", "format"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["templater", "config", "nocolor", "verbose", "fixed_suffix", "show_lint"]