GitHub Action to validate Elm code is formatted correctly
Go to file
dependabot[bot] 425ef5be25
Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-26 13:37:31 +00:00
__tests__ Update elm-format 2021-01-08 11:16:39 +00:00
.github/workflows Use new GITHUB_PATH file 2021-01-08 10:59:00 +00:00
dist Update typescript 2021-01-08 11:12:57 +00:00
src Upgrade npm deps and fix new eslint errors 2020-08-17 17:51:02 +01:00
.eslintignore Initial commit 2020-04-20 18:11:39 +01:00
.eslintrc.json Upgrade npm deps and fix new eslint errors 2020-08-17 17:51:02 +01:00
.gitignore Ignore .idea 2021-01-08 11:03:18 +00:00
.prettierignore Initial commit 2020-04-20 18:11:39 +01:00
.prettierrc.json Initial commit 2020-04-20 18:11:39 +01:00
action.yml Add missing 'working-directory' to action.yml 2021-01-08 11:21:40 +00:00
jest.config.js Initial commit 2020-04-20 18:11:39 +01:00
LICENSE Update package and author details 2020-05-30 10:07:23 +01:00
package.json Update elm-format 2021-01-08 11:16:39 +00:00
README.md Use new GITHUB_PATH file 2021-01-08 10:59:00 +00:00
tsconfig.eslint.json Run elm-format and turn results into warnings 2020-04-22 09:25:37 +01:00
tsconfig.json Initial commit 2020-04-20 18:11:39 +01:00
yarn.lock Bump minimist from 1.2.5 to 1.2.6 2022-03-26 13:37:31 +00:00

elm-format-action status

elm-format --validate

Validate your Elm files using elm-format - any unformatted files will cause the check to fail and a note will be added to each failing file.

Finding elm-format

You must have elm-format available in your build, here is an example where elm-format is in package.json.

jobs:
  lint:
    steps:
    - uses: actions/checkout@v2
    - run: yarn
    - name: Add elm-format to path
      run: yarn bin >> $GITHUB_PATH
    - uses: sparksp/elm-format-action@v1
      with: 
        # elm_format: elm-format
        # elm_files: src/
        # elm_glob: false
        # working-directory: ./

Multiple Files

To match multiple files or directories, list each on a new line...

    - uses: sparksp/elm-format-action@v1
      with: 
        elm_files: |
          src/Main.elm
          src/Wait.elm
          tests/          

File Glob

This action supports file globs using @actions/glob. elm-format will process each file or directory it is given, so take care to match only elm files OR directories with your globs.

    - uses: sparksp/elm-format-action@v1
      with: 
        # Match all elm files except any TW.elm
        elm_files: |
          src/**/*.elm
          !**/TW.elm          
        elm_glob: true