Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the Blue Style guide, and automatically make PRs to fix code formatting #414

Merged
merged 1 commit into from
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/format_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Code Formatting
on:
push:
branches:
- master
workflow_dispatch:
jobs:
format_pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install the JuliaFormatter package
run: julia --color=yes -e 'using Pkg; Pkg.add(name = "JuliaFormatter", uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899")'
- name: Precompile dependencies
run: julia --color=yes -e 'using Pkg; Pkg.precompile()'
- name: Use JuliaFormatter to format the code with the BlueStyle style
run: julia --color=yes -e 'using JuliaFormatter; format(".", BlueStyle(); verbose = true)'
- name: Create pull request
id: create_pr
uses: peter-evans/create-pull-request@9825ae65b1cb54b543b938503728b432a0176d29 # v3.10.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: '🤖 Automatically format the source code files'
title: '🤖 Automatically format the source code files'
body: 'This pull request formats the source code files using the JuliaFormatter package.'
branch: bot/format_pr/${{ github.ref }}
delete-branch: true
- run: echo "The pull request number is ${{ steps.create_pr.outputs.pull-request-number }}"
- run: echo "The pull request URL is ${{ steps.create_pr.outputs.pull-request-url }}"
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| Integration Tests | [![Continuous Integration (Integration Tests)][ci-integration-img]][ci-integration-url] |
| Documentation | [![Documentation (stable)][docs-stable-img]][docs-stable-url] [![Documentation (dev)][docs-dev-img]][docs-dev-url] |
| Code Coverage | [![Code Coverage][codecov-img]][codecov-url] |
| Style Guide | [![Style Guide][bluestyle-img]][bluestyle-url] |

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

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