datasecops-cli 0.2.2__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/CHANGELOG.md +12 -0
  2. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/PKG-INFO +1 -1
  3. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/pyproject.toml +1 -1
  4. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/menus/development.py +9 -8
  5. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/services/download_service.py +10 -2
  6. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/services/linting_service.py +9 -0
  7. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/.github/workflows/publish-cli.yml +0 -0
  8. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/.gitignore +0 -0
  9. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/DEVELOPMENT.md +0 -0
  10. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/LICENSE +0 -0
  11. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/README.md +0 -0
  12. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/docs/getting-started.md +0 -0
  13. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/docs/legacy.md +0 -0
  14. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/docs/legacy_plan_of_action.md +0 -0
  15. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/docs/mcp-server.md +0 -0
  16. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/mcp-servers.json +0 -0
  17. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/setup.ps1 +0 -0
  18. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/setup.sh +0 -0
  19. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/__init__.py +0 -0
  20. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/config.py +0 -0
  21. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/main.py +0 -0
  22. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/menus/__init__.py +0 -0
  23. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/menus/downloads.py +0 -0
  24. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/menus/git_operations.py +0 -0
  25. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/models/__init__.py +0 -0
  26. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/models/git_helpers.py +0 -0
  27. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/models/project_config.py +0 -0
  28. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/services/__init__.py +0 -0
  29. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/services/bootstrap_service.py +0 -0
  30. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/services/dbt_runner.py +0 -0
  31. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/services/git_service.py +0 -0
  32. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/services/skill_service.py +0 -0
  33. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/services/snowflake_service.py +0 -0
  34. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/utilities/__init__.py +0 -0
  35. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/utilities/display.py +0 -0
  36. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/utilities/file_utils.py +0 -0
  37. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_cli/utilities/yaml_utils.py +0 -0
  38. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_mcp/__init__.py +0 -0
  39. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_mcp/__main__.py +0 -0
  40. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_mcp/connection.py +0 -0
  41. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/src/datasecops_mcp/server.py +0 -0
  42. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/tests/__init__.py +0 -0
  43. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/tests/test_config.py +0 -0
  44. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/tests/test_file_utils.py +0 -0
  45. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/tests/test_models.py +0 -0
  46. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/tests/test_version.py +0 -0
  47. {datasecops_cli-0.2.2 → datasecops_cli-0.2.3}/tests/test_yaml_utils.py +0 -0
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to the DataSecOps CLI are documented in this file.
4
4
 
5
+ ## [0.2.3] - 2026-05-11
6
+
7
+ ### Fixed
8
+
9
+ - **Stripped invalid `dbt_skip_compilation_error` option** from the generated `[sqlfluff:templater:dbt]` section — this native app field is not a valid sqlfluff config key and caused parse errors
10
+ - **`profiles_dir = ${DBT_PROFILES_DIR}` no longer leaks** into generated config — the raw value from the native app is now always replaced with the resolved local path or removed entirely
11
+ - **Empty string values** (e.g. `warnings = ""`) now emit `None` instead of blank, matching sqlfluff's expected INI format
12
+
13
+ ### Added
14
+
15
+ - **Auto-install `sqlfluff-templater-dbt`** — the lint menu now checks for missing sqlfluff packages before linting and installs them automatically
16
+
5
17
  ## [0.2.2] - 2026-05-10
6
18
 
7
19
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datasecops-cli
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: DataSecOps Framework CLI for Snowflake Native App
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "datasecops-cli"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "DataSecOps Framework CLI for Snowflake Native App"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -141,15 +141,16 @@ class DevelopmentMenu:
141
141
  complete_action()
142
142
 
143
143
  def _ensure_sqlfluff_config(self) -> bool:
144
- """Download .sqlfluff from the framework if it doesn't exist locally."""
144
+ """Download .sqlfluff from the framework if it doesn't exist locally, and ensure templater is installed."""
145
145
  config_path = self.linting.project_dir / ".sqlfluff"
146
- if config_path.exists():
147
- return True
148
- if not self.downloads:
149
- error_line("No .sqlfluff config found and download service not available")
150
- return False
151
- info_line("No .sqlfluff config found — downloading from framework...")
152
- return self.downloads.download_sqlfluff_config(profiles_dir=self.profiles_dir)
146
+ if not config_path.exists():
147
+ if not self.downloads:
148
+ error_line("No .sqlfluff config found and download service not available")
149
+ return False
150
+ info_line("No .sqlfluff config found — downloading from framework...")
151
+ if not self.downloads.download_sqlfluff_config(profiles_dir=self.profiles_dir):
152
+ return False
153
+ return self.linting.ensure_templater_installed()
153
154
 
154
155
  def _lint_menu(self) -> None:
155
156
  clear()
@@ -69,6 +69,11 @@ class DownloadService:
69
69
  self.sf = snowflake_service
70
70
  self.project_dir = project_dir
71
71
 
72
+ # Options to strip from specific core sections (not valid sqlfluff config keys).
73
+ CORE_STRIP_OPTIONS: dict[str, set[str]] = {
74
+ "dbt": {"dbt_skip_compilation_error"},
75
+ }
76
+
72
77
  @staticmethod
73
78
  def _format_value(val) -> str:
74
79
  """Format a JSON value for sqlfluff INI output."""
@@ -106,13 +111,16 @@ class DownloadService:
106
111
  if not isinstance(entry, dict) or not entry.get("enabled", True):
107
112
  continue
108
113
  opts = dict(entry.get("options", {}))
114
+ # Strip options that are not valid sqlfluff config keys
115
+ for strip_key in self.CORE_STRIP_OPTIONS.get(key, set()):
116
+ opts.pop(strip_key, None)
109
117
  if key == "dbt":
110
118
  # Override profiles_dir / project_dir with local values
111
119
  opts["project_dir"] = "."
112
120
  if profiles_dir:
113
121
  opts["profiles_dir"] = profiles_dir
114
- elif "profiles_dir" in opts:
115
- del opts["profiles_dir"]
122
+ else:
123
+ opts.pop("profiles_dir", None)
116
124
  if opts:
117
125
  self._emit_section(lines, section_header, opts)
118
126
 
@@ -43,6 +43,15 @@ class LintingService:
43
43
  error_line(f"pip install failed with exit code {result.returncode}")
44
44
  return False
45
45
 
46
+ def ensure_templater_installed(self) -> bool:
47
+ """Check if sqlfluff-templater-dbt is installed; install it if missing."""
48
+ versions = self.get_installed_versions()
49
+ missing = [pkg for pkg in ["sqlfluff", "sqlfluff-templater-dbt"] if not versions.get(pkg)]
50
+ if not missing:
51
+ return True
52
+ warning_line(f"Missing packages: {', '.join(missing)}")
53
+ return self.install_requirements(missing)
54
+
46
55
  def lint_file(self, file_path: str = None, fix: bool = False) -> subprocess.CompletedProcess:
47
56
  action = "fix" if fix else "lint"
48
57
  cmd = ["sqlfluff", action]
File without changes
File without changes
File without changes
File without changes