1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Example GitHub Actions workflow for using LineGuard in your project
name: Lint
on:
push:
branches:
pull_request:
branches:
jobs:
lineguard:
name: Check Line Endings
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Option 1: Install from crates.io (recommended)
- name: Install LineGuard
run: |
cargo install lineguard
# Option 2: Download pre-built binary
# - name: Install LineGuard
# run: |
# curl -L https://github.com/hydai/lineguard/releases/latest/download/lineguard-x86_64-unknown-linux-gnu.tar.gz | tar xz
# sudo mv lineguard /usr/local/bin/
- name: Run LineGuard
run: |
lineguard --format github .
# Optional: Auto-fix issues
# - name: Fix issues
# run: |
# lineguard --fix .
#
# - name: Commit fixes
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: "style: fix line endings and trailing spaces"
# if: github.event_name == 'pull_request'