Merge pull request #125290 from fabaff/sqlfluff

sqlfluff: init at 0.6.0a2
This commit is contained in:
Sandro 2021-06-10 21:09:10 +02:00 committed by GitHub
commit 2c4a7e6e47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,65 @@
{ lib
, fetchFromGitHub
, python3
}:
python3.pkgs.buildPythonApplication rec {
pname = "sqlfluff";
version = "0.6.0a2";
disabled = python3.pythonOlder "3.6";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
sha256 = "13hzr0jialzi2nlvqwvff3w0h6jikqvcg0p2p4irwlisg4db8w7w";
};
propagatedBuildInputs = with python3.pkgs; [
appdirs
cached-property
click
colorama
configparser
diff_cover
jinja2
oyaml
pathspec
pytest
tblib
toml
] ++ lib.optionals (pythonOlder "3.7") [
dataclasses
] ++ lib.optionals (pythonOlder "3.9") [
typing-extensions
];
checkInputs = with python3.pkgs; [
hypothesis
pytestCheckHook
];
disabledTestPaths = [
# dbt is not available yet
"test/core/templaters/dbt_test.py"
# Don't run the plugin related tests
"test/core/plugin_test.py"
"plugins/sqlfluff-plugin-example/test/rules/rule_test_cases_test.py"
];
disabledTests = [
# dbt is not available yet
"test__linter__skip_dbt_model_disabled"
"test_rules__test_helper_has_variable_introspection"
"test__rules__std_file_dbt"
];
pythonImportsCheck = [ "sqlfluff" ];
meta = with lib; {
description = "SQL linter and auto-formatter";
homepage = "https://www.sqlfluff.com/";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}

View file

@ -11983,6 +11983,8 @@ in
jdk = oraclejdk;
};
sqlfluff = callPackage ../development/tools/database/sqlfluff { };
sqlx-cli = callPackage ../development/tools/rust/sqlx-cli {
inherit (darwin.apple_sdk.frameworks) SystemConfiguration CoreFoundation Security;
};