Skip to content

Commit c96767c

Browse files
Merge #414
414: Use the Blue Style guide, and automatically make PRs to fix code formatting r=DilumAluthge a=DilumAluthge Co-authored-by: Dilum Aluthge <[email protected]>
2 parents 289890b + aa1eb01 commit c96767c

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.github/workflows/format_pr.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Code Formatting
2+
on:
3+
push:
4+
branches:
5+
- master
6+
workflow_dispatch:
7+
jobs:
8+
format_pr:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Install the JuliaFormatter package
13+
run: julia --color=yes -e 'using Pkg; Pkg.add(name = "JuliaFormatter", uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899")'
14+
- name: Precompile dependencies
15+
run: julia --color=yes -e 'using Pkg; Pkg.precompile()'
16+
- name: Use JuliaFormatter to format the code with the BlueStyle style
17+
run: julia --color=yes -e 'using JuliaFormatter; format(".", BlueStyle(); verbose = true)'
18+
- name: Create pull request
19+
id: create_pr
20+
uses: peter-evans/create-pull-request@9825ae65b1cb54b543b938503728b432a0176d29 # v3.10.0
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
commit-message: '🤖 Automatically format the source code files'
24+
title: '🤖 Automatically format the source code files'
25+
body: 'This pull request formats the source code files using the JuliaFormatter package.'
26+
branch: bot/format_pr/${{ github.ref }}
27+
delete-branch: true
28+
- run: echo "The pull request number is ${{ steps.create_pr.outputs.pull-request-number }}"
29+
- run: echo "The pull request URL is ${{ steps.create_pr.outputs.pull-request-url }}"

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| Integration Tests | [![Continuous Integration (Integration Tests)][ci-integration-img]][ci-integration-url] |
77
| Documentation | [![Documentation (stable)][docs-stable-img]][docs-stable-url] [![Documentation (dev)][docs-dev-img]][docs-dev-url] |
88
| Code Coverage | [![Code Coverage][codecov-img]][codecov-url] |
9+
| Style Guide | [![Style Guide][bluestyle-img]][bluestyle-url] |
910

1011
[docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg "Documentation (stable)"
1112
[docs-stable-url]: https://JuliaRegistries.github.io/RegistryCI.jl/stable
@@ -17,8 +18,8 @@
1718
[ci-integration-url]: https://github.com/JuliaRegistries/RegistryCI.jl/actions?query=workflow%3A%22CI+%28integration+tests%29%22
1819
[codecov-img]: https://codecov.io/gh/JuliaRegistries/RegistryCI.jl/branch/master/graph/badge.svg "Code Coverage"
1920
[codecov-url]: https://codecov.io/gh/JuliaRegistries/RegistryCI.jl/branch/master
20-
[bors-img]: https://bors.tech/images/badge_small.svg "Bors"
21-
[bors-url]: https://app.bors.tech/repositories/25657
21+
[bluestyle-img]: https://img.shields.io/badge/code%20style-blue-4495d1.svg "Blue Style"
22+
[bluestyle-url]: https://github.com/invenia/BlueStyle
2223

2324
RegistryCI.jl
2425
provides continuous integration (CI) tools for Julia package registries, including registry consistency testing, automatic merging (automerge) of pull requests, and automatic TagBot triggers.

0 commit comments

Comments
 (0)