1{ lib
2, fetchFromGitHub
3, python3
4}:
5
6python3.pkgs.buildPythonApplication rec {
7 pname = "sqlfluff";
8 version = "1.4.2";
9
10 src = fetchFromGitHub {
11 owner = pname;
12 repo = pname;
13 rev = "refs/tags/${version}";
14 hash = "sha256-B1tqL8bc+mWEjQrS4lQM55/ahOeUyuE8VBtk6QMj6Mk=";
15 };
16
17 propagatedBuildInputs = with python3.pkgs; [
18 appdirs
19 cached-property
20 chardet
21 click
22 colorama
23 configparser
24 diff-cover
25 jinja2
26 oyaml
27 pathspec
28 pytest
29 regex
30 tblib
31 toml
32 tqdm
33 typing-extensions
34 ] ++ lib.optionals (pythonOlder "3.7") [
35 dataclasses
36 ] ++ lib.optionals (pythonOlder "3.8") [
37 backports.cached-property
38 importlib_metadata
39 ];
40
41 checkInputs = with python3.pkgs; [
42 hypothesis
43 pytestCheckHook
44 ];
45
46 disabledTestPaths = [
47 # Don't run the plugin related tests
48 "test/core/plugin_test.py"
49 "plugins/sqlfluff-templater-dbt"
50 "plugins/sqlfluff-plugin-example/test/rules/rule_test_cases_test.py"
51 ];
52
53 disabledTests = [
54 # dbt is not available yet
55 "test__linter__skip_dbt_model_disabled"
56 "test_rules__test_helper_has_variable_introspection"
57 "test__rules__std_file_dbt"
58 ];
59
60 pythonImportsCheck = [
61 "sqlfluff"
62 ];
63
64 meta = with lib; {
65 description = "SQL linter and auto-formatter";
66 homepage = "https://www.sqlfluff.com/";
67 license = with licenses; [ mit ];
68 maintainers = with maintainers; [ fab ];
69 };
70}