Skip to content

Commit

Permalink
clean up file system + add formatter to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
NickMcSweeney committed May 29, 2024
1 parent 12e6689 commit 098bd18
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 281 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/JuliaFormatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Code Formatting

on:
pull_request:
branches:
- main

jobs:
format:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write
actions: write

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]

- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- uses: julia-actions/setup-julia@v2
with:
version: 1.9

- name: Install JuliaFormatter and format
shell: bash
run: julia -e 'import Pkg; Pkg.add("JuliaFormatter"); using JuliaFormatter; format(".")'

- name: Create Pull Request
id: pr
uses: peter-evans/create-pull-request@v6
with:
commit-message: Format files using JuliaFormatter
title: ${{ format('[AUTO] Format {0} using JuliaFormatter', github.event.pull_request.number) }}
body: ${{ format('[JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl) would suggest these formatting changes against \#{0}.', github.event.pull_request.number) }}
labels: no changelog
branch: ${{ format('code-format/{0}', github.event.pull_request.number) }}
delete-branch: true

- name: Fail if a PR was needed
if: ${{ steps.pr.outputs.pull-request-operation == 'created' || steps.pr.outputs.pull-request-operation == 'updated' }}
shell: bash
run: exit 1
135 changes: 0 additions & 135 deletions test/dev/mocksocket.jl

This file was deleted.

146 changes: 0 additions & 146 deletions test/dev/packet.jl

This file was deleted.

0 comments on commit 098bd18

Please sign in to comment.