Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

chore: minify test json files #2341

Merged
merged 1 commit into from
Apr 12, 2023
Merged

Conversation

DaniPopes
Copy link
Collaborator

@DaniPopes DaniPopes commented Apr 10, 2023

Motivation

A windows test broke in #2293 due to actual \r\n vs expected \n.

Solution

Reproduce with:

minify () {
        for f
        do
                out="$(jq -rc . "$f" 2>&1)" 
                if [ $? -ne 0 ]
                then
                        echo "$out" >&2
                        continue
                fi
                echo "writing $f" >&2
                printf "%s\n" "$out" > "$f"
        done
}

minify **/*.json
git restore ethers-addressbook

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supportive of minifying all json files

looks like this caused some issues with abigen code

@DaniPopes
Copy link
Collaborator Author

DaniPopes commented Apr 10, 2023

apparently jq can't handle utf-8 and echo may interpret escape codes like \n. Updated script and pushed fixes

@DaniPopes DaniPopes requested a review from mattsse April 10, 2023 20:17
@gakonst gakonst merged commit 2d6a944 into gakonst:master Apr 12, 2023
@DaniPopes DaniPopes deleted the chore/minify branch April 12, 2023 15:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants