-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |