Skip to content

Commit

Permalink
Update run_static_lint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
bergel authored Mar 6, 2024
1 parent 95fb85f commit ddba065
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions scripts/run_static_lint.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
#!/bin/bash

# EXPECT StaticLint.jl TO BE PRESENT.
# This bash script expects two things:
# - RelationalAI/StaticLint.jl to be cloned
# - The file files_to_run_lint.txt that contains files on which StaticLint.jl has to be run
# Output of this script is a file result.txt that contains the generated report of StaticLint
# This script is invoked by the run_lint.yml GitHub Action workflow.

GITHUB_REPOSITORY=$1
BRANCH_NAME=$2
FILE_PREFIX_TO_REMOVE=$3

cd StaticLint.jl
julia --proj -e "import Pkg ; Pkg.Registry.update() ; Pkg.instantiate() ; Pkg.build()"
julia --proj -e "import Pkg ; Pkg.Registry.update() ; Pkg.instantiate()"
cd ..

# WRITING FILES ON WHICH LINT SHOULD BE RUN
echo "FILES TO BE LINTED"
cat files_to_run_lint.txt

# RUNNING THE CHECK
julia --project=StaticLint.jl -e "
using StaticLint
StaticLint.generate_report(readlines(\"files_to_run_lint.txt\"), \"result.txt\")
StaticLint.generate_report(
readlines(\"files_to_run_lint.txt\"),
\"result.txt\";
github_repository=\"$GITHUB_REPOSITORY\",
branch_name=\"$BRANCH_NAME\",
file_prefix_to_remove=\"$FILE_PREFIX_TO_REMOVE\",
)
"

# SHOW THE RESULTS ON GITHUB ACTION. USEFUL FOR DEBUGGING
echo "HERE ARE THE RESULTS:"
cat result.txt
echo "END OF RESULTS"
# echo "HERE ARE THE RESULTS:"
# cat result.txt
# echo "END OF RESULTS"

0 comments on commit ddba065

Please sign in to comment.