Skip to content

Commit

Permalink
add style enforcement
Browse files Browse the repository at this point in the history
  • Loading branch information
palday committed Apr 4, 2024
1 parent 6d8ea2c commit 4391def
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Style-Enforcer
on:
push:
branches:
- main
- /^release-.*$/
tags: ["*"]
paths:
- "**/*.jl"
- ".github/workflows/FormatCheck.yml"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "**/*.jl"
- ".github/workflows/FormatCheck.yml"
jobs:
format-check:
name: YAS
# These permissions are needed to:
# - Delete old caches: https://github.com/julia-actions/cache#usage
# - Post formatting suggestions: https://github.com/reviewdog/action-suggester#required-permissions
permissions:
actions: write
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: "1"
- uses: julia-actions/cache@v1
- name: Install JuliaFormatter
shell: julia --project=@format --color=yes {0}
run: |
using Pkg
Pkg.add(PackageSpec(; name="JuliaFormatter", version="1"))
- name: Check formatting
shell: julia --project=@format --color=yes {0}
run: |
using JuliaFormatter
format(".", YASStyle(); verbose=true)
- uses: reviewdog/action-suggester@v1
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
with:
tool_name: JuliaFormatter
fail_on_error: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://RePsychLing.github.io/MixedModelsSim.jl/dev)
[![CI](https://github.com/RePsychLing/MixedModelsSim.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/RePsychLing/MixedModelsSim.jl/actions/workflows/CI.yml)
[![Codecov](https://codecov.io/gh/RePsychLing/MixedModelsSim.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/RePsychLing/MixedModelsSim.jl)
[![Code Style: YAS](https://img.shields.io/badge/code%20style-yas-1fdcb3.svg)](https://github.com/jrevels/YASGuide)

This package provides some utility functions for generating experimental designs, especially those with crossed factors.

Expand Down

0 comments on commit 4391def

Please sign in to comment.