2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "sqlfluff";
|
2022-12-28 21:21:41 +00:00
|
|
|
version = "1.4.5";
|
|
|
|
format = "setuptools";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2022-04-15 01:41:22 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2022-12-28 21:21:41 +00:00
|
|
|
hash = "sha256-Kc0doBR2iOy54arxOYXH5eHlcM7pXFVUqedopsZH8rE=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
appdirs
|
|
|
|
cached-property
|
2022-01-07 04:07:37 +00:00
|
|
|
chardet
|
2021-06-28 23:13:55 +00:00
|
|
|
click
|
|
|
|
colorama
|
|
|
|
configparser
|
2021-08-05 21:33:18 +00:00
|
|
|
diff-cover
|
2021-06-28 23:13:55 +00:00
|
|
|
jinja2
|
|
|
|
oyaml
|
|
|
|
pathspec
|
|
|
|
pytest
|
2022-01-07 04:07:37 +00:00
|
|
|
regex
|
2021-06-28 23:13:55 +00:00
|
|
|
tblib
|
|
|
|
toml
|
2021-12-06 16:07:01 +00:00
|
|
|
tqdm
|
2021-08-12 14:41:47 +00:00
|
|
|
typing-extensions
|
2022-01-07 04:07:37 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
backports.cached-property
|
|
|
|
importlib_metadata
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with python3.pkgs; [
|
2021-06-28 23:13:55 +00:00
|
|
|
hypothesis
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Don't run the plugin related tests
|
|
|
|
"plugins/sqlfluff-plugin-example/test/rules/rule_test_cases_test.py"
|
2022-12-28 21:21:41 +00:00
|
|
|
"plugins/sqlfluff-templater-dbt"
|
|
|
|
"test/core/plugin_test.py"
|
|
|
|
"test/diff_quality_plugin_test.py"
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# dbt is not available yet
|
|
|
|
"test__linter__skip_dbt_model_disabled"
|
|
|
|
"test_rules__test_helper_has_variable_introspection"
|
|
|
|
"test__rules__std_file_dbt"
|
|
|
|
];
|
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"sqlfluff"
|
|
|
|
];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "SQL linter and auto-formatter";
|
|
|
|
homepage = "https://www.sqlfluff.com/";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/sqlfluff/sqlfluff/blob/${version}/CHANGELOG.md";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|