Skip to content

Commit 1763e6f

Browse files
authored
Merge pull request #4 from RelationalAI/axb-pre-commit
Pre-commit integration
2 parents dd07c44 + 4fbcb89 commit 1763e6f

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.pre-commit-hooks.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- id: check-metadata-of-derived-functions
2+
name: check-metadata-of-derived-functions
3+
description: Check if metadata of derived functions needs to be updated
4+
language: script
5+
entry: ./scripts/check-metadata-of-derived-functions.sh
6+
types: [file]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
FILES_TO_CHECK=$@
4+
5+
# echo "Checking metadata of derived functions in the following files: $FILES_TO_CHECK"
6+
7+
julia --project=. -e "
8+
using Pkg
9+
Pkg.instantiate()
10+
11+
# Convert the filenames into an array of strings
12+
filenames = split(\"$FILES_TO_CHECK\", \" \")
13+
14+
using MetadataUpdater
15+
env = MetadataUpdater.fetch_metadatainfo_filenames(filenames)
16+
MetadataUpdater.print_summary(env)
17+
# WE NEED TO EXTRACT THE ROOT FOR THE METADATA REGISTRY TOML FILE!!!!!!!!
18+
19+
# if !check(env)
20+
# @error \"ERROR FOUND! NEED TO update the metadata registry with:
21+
# using RAICode.MetadataRegistry
22+
# MetadataRegistry.persist_metadata_registry_manifest()
23+
# \"
24+
# exit(1)
25+
# end
26+
# println(\"👍All Good! No discrepancies between source code and the metadata registry.\")
27+
exit(0)
28+
"
29+
30+
# We use the same exit value as the julia script
31+
exit $?

0 commit comments

Comments
 (0)