fix: suppress 'press q' prompt when input_stream is devnull (#623) #2567
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Taken from https://github.com/julia-actions/julia-format | |
| name: format-check | |
| on: | |
| push: | |
| branches: | |
| - "master" | |
| - "release-*" | |
| tags: "*" | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| julia-version: [1] | |
| os: [ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: julia-actions/setup-julia@v3 | |
| with: | |
| version: ${{ matrix.julia-version }} | |
| - name: "Cache dependencies" | |
| uses: julia-actions/cache@v3 | |
| - name: Install JuliaFormatter and format | |
| run: | | |
| julia --startup-file=no -e 'using Pkg; pkg"activate --temp"; pkg"add JuliaFormatter@2.4.0"; using JuliaFormatter; format("."; verbose=true)' | |
| - name: "Format check" | |
| run: | | |
| julia -e ' | |
| out = Cmd(`git diff --name-only`) |> read |> String | |
| if out == "" | |
| exit(0) | |
| else | |
| @error "Some files have not been formatted. Please run JuliaFormatter.format(\".\") from the repository root." | |
| write(stdout, out) | |
| exit(1) | |
| end' |