File: formatters.yaml

package info (click to toggle)
libmodulemd 2.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,152 kB
  • sloc: ansic: 37,845; python: 3,236; xml: 1,739; sh: 377; makefile: 42
file content (30 lines) | stat: -rw-r--r-- 768 bytes parent folder | download
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
name: Automatic Code Formatters
on: push

jobs:
  autoformat:
    name: Auto-format code
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Install formatters
        run: |
          sudo apt-get update
          sudo apt-get install clang-format black

      - name: Format code
        run: |
          clang-format -i --verbose $(find . -name "*.[ch]")
          black --target-version py36 --verbose --line-length 79 .

      - name: Commit changes
        uses: EndBug/add-and-commit@v9
        with:
          author_name: Libmodulemd CI
          author_email: github-actions@github.com
          message: 'Code auto-formatting'
          add: -u
          commit: --signoff
          push: true