Skip to content

GarnerCorp/scalafmt-ci

 
 

Repository files navigation

Scalafmt GitHub Action

Run scalafmt on your repository automatically with every push.

By default, it runs with --list, but that's configurable.

Uses scalafmt-native under the hood to keep things small and booting super quick by avoiding the JVM. 🐎

Usage

Simply add a step such as the following to your your workflow yml file:

- name: Check for scalafmt conformance
  uses: garnercorp/scalafmt-ci@v3

Example in the full context of a workflow file, with some optional arguments:

name: Check scalafmt on push
on: [push]

jobs:
  scalafmt-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Checking your code to see if u r naughty or nice
        uses: garnercorp/scalafmt-ci@v3
        with:
          args: "--exclude=third_party --list"
          version: 3.7.17

Compatibility

v2 to v3

  • v2 is built around scalafmt 3.5.2, v3 is built around scalafmt 3.7+
    • The formatting defaults have changed
    • --list --test is no longer accepted as arguments, you should try just one of them.

About

GitHub Action to lint with scalafmt

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 55.8%
  • Perl 25.1%
  • Makefile 19.1%