Skip to content

Commit 6b8ffb2

Browse files
authored
Merge pull request #1035 from JuliaRobotics/23Q3/enh/jlfrmt
add JuliaFormatter
2 parents 17f63da + 72c3d18 commit 6b8ffb2

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.JuliaFormatter.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
indent = 2
2+
always_for_in = false #
3+
whitespace_typedefs = true
4+
whitespace_ops_in_indices = true
5+
remove_extra_newlines = true
6+
import_to_using = false #
7+
pipe_to_function_call = false #
8+
short_to_long_function_def = true
9+
always_use_return = true
10+
whitespace_in_kwargs = true #
11+
annotate_untyped_fields_with_any = true #
12+
conditional_to_if = true
13+
separate_kwargs_with_semicolon = true

.github/workflows/Formatter.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Format
2+
on:
3+
push:
4+
branches: [master]
5+
tags: [v*]
6+
pull_request:
7+
8+
jobs:
9+
format:
10+
name: "Format Check"
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: julia-actions/setup-julia@v1
15+
with:
16+
version: 1
17+
- uses: julia-actions/cache@v1
18+
- name: Install JuliaFormatter and format
19+
run: |
20+
using Pkg
21+
Pkg.add(PackageSpec(name="JuliaFormatter"))
22+
using JuliaFormatter
23+
format("."; verbose=true)
24+
shell: julia --color=yes {0}
25+
- name: Suggest formatting changes
26+
uses: reviewdog/action-suggester@v1
27+
if: github.event_name == 'pull_request'
28+
with:
29+
tool_name: JuliaFormatter
30+
fail_on_error: true

0 commit comments

Comments
 (0)