Skip to content
This repository was archived by the owner on Jan 12, 2025. It is now read-only.

Commit 40f3cdf

Browse files
ovirsovirs
andauthored
Extend the the sqlfluff feature to support the injection on sqlfluff plugins (#551)
Co-authored-by: ovirs <[email protected]>
1 parent 5c96e8d commit 40f3cdf

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

src/sqlfluff/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ Fluff is an extensible and modular linter designed to help you write good SQL an
1616
| Options Id | Description | Type | Default Value |
1717
|-----|-----|-----|-----|
1818
| version | Select the version to install. | string | latest |
19-
19+
| plugins | A space delimitered list of sqlfluff plugins (will be injected into the sqlfluff pipx env). See proposals for examples. | string | - |
2020

src/sqlfluff/devcontainer-feature.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@
1212
"latest"
1313
],
1414
"type": "string"
15+
},
16+
"plugins": {
17+
"default": "",
18+
"description": "A space delimitered list of sqlfluff plugins (will be injected into the sqlfluff pipx env). See proposals for examples.",
19+
"proposals": [
20+
"sqlfluff-templater-dbt==2.3.5",
21+
"sqlfluff-templater-dbt sqlfluff-plugin-sparksql-upgrade"
22+
],
23+
"type": "string"
1524
}
1625
},
1726
"installsAfter": [
1827
"ghcr.io/devcontainers-contrib/features/pipx-package",
1928
"ghcr.io/devcontainers/features/python"
2029
]
21-
}
30+
}

src/sqlfluff/install.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ set -e
55

66
# nanolayer is a cli utility which keeps container layers as small as possible
77
# source code: https://github.com/devcontainers-contrib/nanolayer
8-
# `ensure_nanolayer` is a bash function that will find any existing nanolayer installations,
9-
# and if missing - will download a temporary copy that automatically get deleted at the end
8+
# `ensure_nanolayer` is a bash function that will find any existing nanolayer installations,
9+
# and if missing - will download a temporary copy that automatically get deleted at the end
1010
# of the script
1111
ensure_nanolayer nanolayer_location "v0.5.0"
1212

@@ -15,8 +15,8 @@ $nanolayer_location \
1515
install \
1616
devcontainer-feature \
1717
"ghcr.io/devcontainers-contrib/features/pipx-package:1.1.7" \
18-
--option package='sqlfluff' --option version="$VERSION"
19-
18+
--option package='sqlfluff' --option version="$VERSION" --option injections="$PLUGINS"
19+
2020

2121

2222
echo 'Done!'

0 commit comments

Comments
 (0)