Skip to content

Commit

Permalink
add style enforcement (#72)
Browse files Browse the repository at this point in the history
* add style enforcement

* concurrency

* YAS
  • Loading branch information
palday authored Apr 4, 2024
1 parent 6d8ea2c commit 3dc8b4b
Show file tree
Hide file tree
Showing 13 changed files with 343 additions and 287 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Tests
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
on:
push:
branches:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Documenter
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
on:
push:
branches: [main]
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Style-Enforcer
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
on:
push:
branches:
- main
- /^release-.*$/
tags: ["*"]
paths:
- "**/*.jl"
- ".github/workflows/style.yml"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "**/*.jl"
- ".github/workflows/style.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
18 changes: 7 additions & 11 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using Documenter
using MixedModelsSim

makedocs(
sitename = "MixedModelsSim.jl",
doctest = true,
authors = "Phillip Alday, Douglas Bates, Lisa DeBruine, Reinhold Kliegl",
pages = [
"index.md",
"Rapid Start" => "simulation.md",
"Beginner Friendly Tutorial" => "simulation_tutorial.md",
],
)
makedocs(; sitename="MixedModelsSim.jl",
doctest=true,
authors="Phillip Alday, Douglas Bates, Lisa DeBruine, Reinhold Kliegl",
pages=["index.md",
"Rapid Start" => "simulation.md",
"Beginner Friendly Tutorial" => "simulation_tutorial.md"])

deploydocs(; repo = "github.com/RePsychLing/MixedModelsSim.jl", push_preview = true)
deploydocs(; repo="github.com/RePsychLing/MixedModelsSim.jl", push_preview=true)
Loading

0 comments on commit 3dc8b4b

Please sign in to comment.