Skip to content

Commit

Permalink
chore: ga for formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
myronrotter committed Nov 4, 2024
1 parent 16cfdc7 commit 5aa3996
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 12 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/go-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Go Fmt

on:
pull_request:
branches:
- main

jobs:
go-famt:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Run gofmt
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "Unformatted files found:"
echo "$unformatted"
exit 1
else
echo "All Go files are properly formatted."
fi
22 changes: 11 additions & 11 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ on:
- main

jobs:
build:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Install dependencies
run: go mod download
- name: Install dependencies
run: go mod download

- name: Run tests
run: go test ./...
- name: Run tests
run: go test ./...
34 changes: 34 additions & 0 deletions .github/workflows/json-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check JSON Formatting

on:
pull_request:
branches:
- main

jobs:
json-fmt:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install jq
run: sudo apt-get install -y jq

- name: Find and check JSON formatting
run: |
unformatted_files=()
for file in $(find ./whitelist -name "*.json"); do
if [ "$(jq . "$file" | diff - "$file")" ]; then
unformatted_files+=("$file")
fi
done
if [ ${#unformatted_files[@]} -gt 0 ]; then
echo "The following JSON files are not formatted correctly:"
printf '%s\n' "${unformatted_files[@]}"
exit 1
else
echo "All JSON files are properly formatted."
fi
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Create a pull request (PR) on GitHub to merge your changes into the main branch.

Wait for the PR to be reviewed by the maintainers. Once approved, your changes will be merged, and the new protocol will be added to the whitelist.


## Adding a new Adapter

### 1. Add your Project under `adapters/projects`
Expand Down

0 comments on commit 5aa3996

Please sign in to comment.