Skip to content

Add formatting check and reuse workflows #2

Add formatting check and reuse workflows

Add formatting check and reuse workflows #2

#
# Copyright 2022 Davide Bettio <[email protected]>
# Copyright 2025 Winford (Uncle Grumpy) <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
#
name: "Check Erlang Formatting"
on:
push:
paths:
- 'src/**'
- 'test/**'
- '**/*.erl'
pull_request:
paths:
- 'src/**'
- 'test/**'
- '**/*.erl'
jobs:
format-check:
runs-on: ubuntu-24.04
container: erlang:27
steps:
- name: "Install deps"
run: |
apt install -y git
- name: "Install erlfmt"
run: |
cd ${HOME}
git clone --depth 1 -b v1.6.0 https://github.com/WhatsApp/erlfmt.git
cd erlfmt
rebar3 as release escriptize
- uses: actions/checkout@v4
- name: "Check formatting with erlfmt"
run: |
find . -name *.erl | xargs ${HOME}/erlfmt/_build/release/bin/erlfmt -c