Skip to content

Commit c31fb1d

Browse files
committed
Update pre-commit hook configuration to version v0.0.27 and enhance documentation
- Updated the pre-commit hook version to v0.0.27 in configuration files. - Added new optional arguments for manifest and catalog file paths in the README and documentation. - Clarified requirements for DBT artifacts in the documentation to improve user guidance.
1 parent 2b985af commit c31fb1d

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

.pre-commit-hooks.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111
# --instance-name: Tenant/instance name
1212
# --backend-url: Backend URL (defaults to https://api.myaltimate.com)
1313
# --config-name: Name of config to use from API
14+
# --manifest-path: Path to DBT manifest file (defaults to ./target/manifest.json)
15+
# --catalog-path: Path to DBT catalog file (defaults to ./target/catalog.json)
16+
# --base-path: Base path of the dbt project (defaults to current directory)

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ pip install pre-commit
5757
```yaml
5858
repos:
5959
- repo: https://github.com/AltimateAI/datapilot-cli
60-
rev: v0.0.23 # Always use a specific version tag
60+
rev: v0.0.27 # Always use a specific version tag
6161
hooks:
6262
- id: datapilot_run_dbt_checks
6363
args: [
6464
"--config-path", "./datapilot-config.yaml",
6565
"--token", "${DATAPILOT_TOKEN}",
66-
"--instance-name", "${DATAPILOT_INSTANCE}"
66+
"--instance-name", "${DATAPILOT_INSTANCE}",
67+
"--manifest-path", "./target/manifest.json",
68+
"--catalog-path", "./target/catalog.json"
6769
]
6870
```
6971

docs/hooks.rst

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To use the DataPilot pre-commit hook, follow these steps:
2121
2222
repos:
2323
- repo: https://github.com/AltimateAI/datapilot-cli
24-
rev: v0.0.23 # Use a specific version tag, not 'main'
24+
rev: v0.0.27 # Use a specific version tag, not 'main'
2525
hooks:
2626
- id: datapilot_run_dbt_checks
2727
args: [
@@ -37,7 +37,7 @@ The DataPilot pre-commit hook supports several configuration options:
3737

3838
**Required Configuration:**
3939

40-
- ``rev``: Always use a specific version tag (e.g., ``v0.0.23``) instead of ``main`` for production stability
40+
- ``rev``: Always use a specific version tag (e.g., ``v0.0.27``) instead of ``main`` for production stability
4141

4242
**Optional Arguments:**
4343

@@ -47,6 +47,8 @@ The DataPilot pre-commit hook supports several configuration options:
4747
- ``--backend-url``: Backend URL (defaults to https://api.myaltimate.com)
4848
- ``--config-name``: Name of config to use from API
4949
- ``--base-path``: Base path of the dbt project (defaults to current directory)
50+
- ``--manifest-path``: Path to the DBT manifest file (defaults to {base_path}/target/manifest.json)
51+
- ``--catalog-path``: Path to the DBT catalog file (defaults to {base_path}/target/catalog.json)
5052

5153
**Environment Variables:**
5254

@@ -56,13 +58,15 @@ You can use environment variables for sensitive information:
5658
5759
repos:
5860
- repo: https://github.com/AltimateAI/datapilot-cli
59-
rev: v0.0.23
61+
rev: v0.0.27
6062
hooks:
6163
- id: datapilot_run_dbt_checks
6264
args: [
6365
"--config-path", "./datapilot-config.yaml",
6466
"--token", "${DATAPILOT_TOKEN}",
65-
"--instance-name", "${DATAPILOT_INSTANCE}"
67+
"--instance-name", "${DATAPILOT_INSTANCE}",
68+
"--manifest-path", "./target/manifest.json",
69+
"--catalog-path", "./target/catalog.json"
6670
]
6771
6872
**Configuration File Example:**
@@ -94,8 +98,18 @@ Once the hook is installed, it will run automatically before each commit. The ho
9498

9599
1. **Validate Configuration**: Check that your config file exists and is valid
96100
2. **Authenticate**: Use your provided token and instance name to authenticate
97-
3. **Analyze Changes**: Only analyze files that have changed in the commit
98-
4. **Report Issues**: Display any issues found and prevent the commit if problems are detected
101+
3. **Load DBT Artifacts**: Load manifest and catalog files for analysis
102+
4. **Analyze Changes**: Only analyze files that have changed in the commit
103+
5. **Report Issues**: Display any issues found and prevent the commit if problems are detected
104+
105+
**Required DBT Artifacts:**
106+
107+
The pre-commit hook requires DBT manifest and catalog files to function properly:
108+
109+
- **Manifest File**: Generated by running `dbt compile` or `dbt run`. Default location: `./target/manifest.json`
110+
- **Catalog File**: Generated by running `dbt docs generate`. Default location: `./target/catalog.json`
111+
112+
**Note**: The catalog file is optional but recommended for comprehensive analysis. If not available, the hook will continue without catalog information.
99113

100114
**Manual Execution:**
101115

@@ -115,6 +129,8 @@ To run individual hooks:
115129

116130
- **Authentication Issues**: Ensure your token and instance name are correctly set
117131
- **Empty Config Files**: The hook will fail if your config file is empty or invalid
132+
- **Missing Manifest File**: Ensure you have run `dbt compile` or `dbt run` to generate the manifest.json file
133+
- **Missing Catalog File**: Run `dbt docs generate` to create the catalog.json file (optional but recommended)
118134
- **No Changes**: If no relevant files have changed, the hook will skip execution
119135
- **Network Issues**: Ensure you have access to the DataPilot API
120136

@@ -150,13 +166,15 @@ Here's a complete example of a ``.pre-commit-config.yaml`` file:
150166
- id: black
151167
152168
- repo: https://github.com/AltimateAI/datapilot-cli
153-
rev: v0.0.23
169+
rev: v0.0.27
154170
hooks:
155171
- id: datapilot_run_dbt_checks
156172
args: [
157173
"--config-path", "./datapilot-config.yaml",
158174
"--token", "${DATAPILOT_TOKEN}",
159-
"--instance-name", "${DATAPILOT_INSTANCE}"
175+
"--instance-name", "${DATAPILOT_INSTANCE}",
176+
"--manifest-path", "./target/manifest.json",
177+
"--catalog-path", "./target/catalog.json"
160178
]
161179
162180
Feedback and Contributions

0 commit comments

Comments
 (0)