diff --git a/README.md b/README.md index cae257f..c40416a 100644 --- a/README.md +++ b/README.md @@ -115,9 +115,9 @@ When the storage is not clean. ## Configuration -| Option | Values | Description | -| -------- | ------ | ---------------------------------------------------- | -| `--skip` | `new` | Does not generate a report with only those findings. | +| Option | Values | Description | +| -------- | ------ | -------------------------------------------------- | +| `--omit` | `new` | Do not generate a report with only those findings. | ## Requirements diff --git a/_reporter.js b/_reporter.js index 21b6f88..dbb7368 100644 --- a/_reporter.js +++ b/_reporter.js @@ -6,9 +6,9 @@ const path = require("path"); const oldData = JSON.parse(process.argv[2]); const newData = JSON.parse(process.argv[3]); const contractPath = path.parse(process.argv[4]); -const skipNew = process.argv[5]; +const omitNew = process.argv[5]; -// Skip if same +// Omit if same if (JSON.stringify(oldData) === JSON.stringify(newData)) process.exit(0); // ========== VISUALIZE LAYOUTS ========== @@ -118,8 +118,8 @@ for (; i < alignedOldVisualized.length; i++) { // ========== OPTIONS ========== -// Skip if only new findings -if (!["🏴", "đŸŗī¸", "🏁", "đŸĒĻ"].some((emoji) => reportNew.includes(emoji)) && skipNew) process.exit(1); +// --omit report if only New findings +if (!["🏴", "đŸŗī¸", "🏁", "đŸĒĻ"].some((emoji) => reportNew.includes(emoji)) && omitNew) process.exit(1); // ========== REPORT FINDINGS ========== diff --git a/run.sh b/run.sh index 24f5f31..6cc2388 100755 --- a/run.sh +++ b/run.sh @@ -10,18 +10,18 @@ fi # Process positional arguments POSITIONAL_ARGS=() -SKIP_NEW=0 +OMIT_NEW=0 # Parsing the command-line arguments while [[ $# -gt 0 ]]; do case "$1" in - --skip) - shift # Remove --skip from processing + --omit) + shift # Remove --omit from processing if [[ $1 == "new" ]]; then - SKIP_NEW=1 + OMIT_NEW=1 shift # Remove the value from processing else - echo "Usage: --skip new" + echo "Usage: --omit new" exit 1 fi ;; @@ -145,6 +145,6 @@ for line in "${filesWithPath_old[@]}"; do cd "$current_dir" output_new=$(forge inspect $formated_name storage) - node ./lib/storage-delta/_reporter.js "$output_old" "$output_new" ${line} $SKIP_NEW + node ./lib/storage-delta/_reporter.js "$output_old" "$output_new" ${line} $OMIT_NEW fi done