1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297
|
[build-system]
requires = ["setuptools>=40.8.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "sqlfluff"
version = "3.5.0"
description = "The SQL Linter for Humans"
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.9"
authors = [
{name = "Alan Cruickshank", email = "alan@designingoverload.com"},
]
license = {file = "LICENSE.md"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: Unix",
"Operating System :: POSIX",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: SQL",
"Topic :: Utilities",
"Topic :: Software Development :: Quality Assurance",
]
keywords = [
"sqlfluff",
"sql",
"linter",
"formatter",
"athena",
"bigquery",
"clickhouse",
"databricks",
"db2",
"doris",
"duckdb",
"exasol",
"flink",
"greenplum",
"hive",
"impala",
"materialize",
"mariadb",
"mysql",
"postgres",
"redshift",
"snowflake",
"soql",
"sparksql",
"sqlite",
"starrocks",
"teradata",
"trino",
"tsql",
"vertica",
"dbt",
]
dependencies = [
# Used for finding os-specific application config dirs
"platformdirs",
# To get the encoding of files.
"chardet",
# Click can include breaking changes in minor releases. Make sure to test
# well before updating upper bound.
"click<=8.3.0",
"colorama>=0.3",
# Used for diffcover plugin
"diff-cover>=2.5.0",
"Jinja2",
# Used for .sqlfluffignore
"pathspec",
# We provide a testing library for plugins in sqlfluff.utils.testing
"pytest",
# We require pyyaml >= 5.1 so that we can preserve the ordering of keys.
"pyyaml>=5.1",
# The new regex module to allow for more complex pattern matching,
# whilst remaining backwards compatible with existing regex use cases.
# e.g. capturing repeated groups in nested tsql block comments.
# This was introduced in https://github.com/sqlfluff/sqlfluff/pull/2027
# and further details can be found in that PR.
"regex",
# For returning exceptions from multiprocessing.Pool.map()
"tblib",
# For parsing pyproject.toml
"tomli; python_version < '3.11'",
# For handling progress bars
"tqdm",
]
[project.urls]
Homepage = "https://www.sqlfluff.com"
Documentation = "https://docs.sqlfluff.com"
Source = "https://github.com/sqlfluff/sqlfluff"
Changes = "https://github.com/sqlfluff/sqlfluff/blob/main/CHANGELOG.md"
"Issue Tracker" = "https://github.com/sqlfluff/sqlfluff/issues"
Twitter = "https://twitter.com/SQLFluff"
Chat = "https://github.com/sqlfluff/sqlfluff#sqlfluff-on-slack"
[project.scripts]
sqlfluff = "sqlfluff.cli.commands:cli"
[project.entry-points.diff_cover]
sqlfluff = "sqlfluff.diff_quality_plugin"
[project.entry-points.sqlfluff]
sqlfluff = "sqlfluff.core.plugin.lib"
# NOTE: We namespace the rules plugins with `rules`, because some
# of them might later collide with other types of plugins. In particular
# `tsql` may eventually refer to a dialect plugin and `jinja` may refer
# to a templater plugin.
sqlfluff_rules_capitalisation = "sqlfluff.rules.capitalisation"
sqlfluff_rules_aliasing = "sqlfluff.rules.aliasing"
sqlfluff_rules_layout = "sqlfluff.rules.layout"
sqlfluff_rules_references = "sqlfluff.rules.references"
sqlfluff_rules_ambiguous = "sqlfluff.rules.ambiguous"
sqlfluff_rules_structure = "sqlfluff.rules.structure"
sqlfluff_rules_convention = "sqlfluff.rules.convention"
sqlfluff_rules_jinja = "sqlfluff.rules.jinja"
sqlfluff_rules_tsql = "sqlfluff.rules.tsql"
[tool.sqlfluff_docs]
# NOTE: Stable version is used by docs/conf.py
stable_version = "3.5.0"
[tool.setuptools.package-data]
# `default_config.cfg` is loaded by sqlfluff as part of config resolution.
# For more details on `py.typed` see https://peps.python.org/pep-0561/
sqlfluff = ["core/default_config.cfg", "py.typed"]
[tool.importlinter]
root_package = "sqlfluff"
[[tool.importlinter.contracts]]
name = "Forbid dependencies outside core"
type = "forbidden"
source_modules = [
"sqlfluff.core",
]
forbidden_modules = [
"sqlfluff.api",
"sqlfluff.cli",
"sqlfluff.dialects",
"sqlfluff.rules",
"sqlfluff.utils",
]
[[tool.importlinter.contracts]]
name = "API may not depend on CLI"
type = "forbidden"
source_modules = [
"sqlfluff.api",
]
forbidden_modules = [
"sqlfluff.cli",
]
[[tool.importlinter.contracts]]
name = "Helper methods must be internally independent"
type = "independence"
modules = [
"sqlfluff.core.helpers.string",
"sqlfluff.core.helpers.slice",
"sqlfluff.core.helpers.dict",
]
[[tool.importlinter.contracts]]
name = "Dependency layers within core"
# NOTE: Several modules within core currently have somewhat more
# convoluted dependency loops, especially when it comes to type checking.
# Those are currently excluded from this work, but might be picked up in
# future work to help with better isolation.
type = "layers"
layers = [
# `linter` references many things, including rules.
"sqlfluff.core.linter",
# `rules` should be independent from linter, but can reference the others.
"sqlfluff.core.rules",
# `parser` should be independent of `rules` and `linter`.
"sqlfluff.core.parser",
# `errors` should be a utility library, which can be referenced by the others.
"sqlfluff.core.errors",
# `types` should be almost independent (but may use helpers)
"sqlfluff.core.types",
# `helpers` should be independent and not reference any of the above.
"sqlfluff.core.helpers",
]
ignore_imports = [
# `errors` references `rules` and `parser`, but only for type checking.
# Splitting it up seems overkill for now, so an allowable exception.
"sqlfluff.core.errors -> sqlfluff.core.rules",
"sqlfluff.core.errors -> sqlfluff.core.parser",
# The plugin host need the BaseRule type for type checking, because one
# of the hooks returns rules. It's otherwise not something we can import
# at this layer.
"sqlfluff.core.plugin.hookspecs -> sqlfluff.core.rules.base",
# The formatter needs the LintedFile type for type checking (and the
# formatter is imported by lots of other things), and we aren't otherwise
# allowed to depend on the linter at this layer.
"sqlfluff.core.formatter -> sqlfluff.core.linter",
]
[tool.mypy]
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
strict_equality = true
extra_checks = true
no_implicit_reexport = true
# skip type checking for 3rd party packages for which stubs are not available
[[tool.mypy.overrides]]
module = "diff_cover.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "tblib.*"
ignore_missing_imports = true
[tool.ruff.lint]
extend-select = ["I", "D"]
# D105: Missing docstring in magic method
# D107: Missing docstring in __init__
# D418: Function/ Method decorated with @overload shouldn’t contain a docstring
ignore = ["D107", "D105", "D418"]
[tool.ruff.lint.isort]
# Mark sqlfluff, test and it's plugins as known first party
known-first-party = [
"sqlfluff",
"sqlfluff_plugin_example",
"sqlfluff_templater_dbt",
"test",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.pytest.ini_options]
python_files = "*_test.py"
testpaths = "test"
markers = [
"dbt: Marks tests needing the \"dbt\" plugin (deselect with '-m \"not dbt\"').",
"integration: Marks tests outside of the core suite.",
"parse_suite: Marks the suite of parsing tests across a range of dialects (part of integration).",
"fix_suite: Marks the suite of fixing tests across a range of dialects (part of integration).",
"rules_suite: Marks the suite of rules tests. Also known as the yaml tests (part of integration).",
]
[tool.doc8]
# Ignore auto-generated docs
ignore-path = "docs/source/_partials/"
[tool.codespell]
# The configuration must be kept here to ensure that
# `codespell` can be run as a standalone program from the CLI
# with the appropriate default options.
skip = "*/test/fixtures/*,*/.*,*/pyproject.toml"
check-hidden = true
quiet-level=2
# ignore-regex = '\\[fnrstv]'
builtin = "clear,rare,informal,names"
ignore-words-list = "fo,ws,falsy,coo,inout,deque,crate,trough,ro,mange,identifers,statment"
# ignore-words = "dev/tools/codespell/codespell-ignore.txt"
# exclude-file = "dev/tools/codespell/codespell-lines-ignore.txt"
uri-ignore-words-list="crate"
# For future reference: it is not currently possible to specify
# the standard dictionary and the custom dictionary in the configuration
# file
# D = "-"
# dictionary = "dev/tools/codespell/codespell-dict.txt"
|