Coder Social home page Coder Social logo

check's Introduction

dprint check action

This action runs dprint check on your source code and fails the build if something is not properly formatted.

Usage

  1. Checkout your repo.
  2. Run dprint/check action.
jobs:
  style:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: dprint/[email protected]

If you are using a matrix, most likely you will only want to run it only on Linux. For example:

- uses: dprint/[email protected]
  if: runner.os == 'Linux'

Latest Version

By default, dprint/check uses the latest version of dprint.

Specific Version

To use a specific version, specify that with the dprint-version input:

- uses: dprint/[email protected]
  with:
    dprint-version: 0.30.3

Config Path

By default, dprint/check uses the auto-discovered configuration file.

Specific Config

To use a specific config, specify that with the config-path input:

- uses: dprint/[email protected]
  with:
    config-path: dprint-ci.json

Troubleshooting

Windows line endings

When running on Windows, you may get a lot of messages like:

from D:\a\check\check\README.md:
 | Text differed by line endings.
--

This is because unfortunately git is configured in GH actions to check out line endings as CRLF (\r\n).

You can fix this by only running the action on Linux as shown above (recommended), or to do the following before checking out the repo:

- name: Ensure LF line endings for Windows
  run: |
    git config --global core.autocrlf false
    git config --global core.eol lf

- uses: actions/checkout@v3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.