Skip to content

Commit

Permalink
chore: run black on all PRs (#13)
Browse files Browse the repository at this point in the history
* chore: run b

* Update black.yaml

* chore: `black .`

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
BobTheBuidler and github-actions[bot] authored Nov 10, 2024
1 parent 1929731 commit e9d1650
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Black Formatter

on:
pull_request:
branches:
- master

jobs:
format:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }} # Check out the PR branch

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install Black
run: pip install black

- name: Run Black
run: black .

- name: Check for changes
id: changes
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "changes_detected=true" >> $GITHUB_ENV
else
echo "changes_detected=false" >> $GITHUB_ENV
fi
- name: Commit changes
if: env.changes_detected == 'true'
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: \`black .\`"
git push
9 changes: 3 additions & 6 deletions evmspec/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,10 @@ def scaled(self) -> "Decimal":
# return Gwei(self) / 10**9


class BlockNumber(uint):
...
class BlockNumber(uint): ...


class Nonce(uint):
...
class Nonce(uint): ...


class UnixTimestamp(uint):
Expand Down Expand Up @@ -210,5 +208,4 @@ async def get_logs(self) -> Tuple["Log", ...]:
pass


class BlockHash(HexBytes32):
...
class BlockHash(HexBytes32): ...

0 comments on commit e9d1650

Please sign in to comment.