-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[WIP] adding pre-commit CI and JuliaFormatter #47094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Format suggestions | ||
|
||
on: | ||
pull_request: | ||
|
||
concurrency: | ||
# Skip intermediate builds: always. | ||
# Cancel intermediate builds: only if it is a pull request build. | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: julia-actions/setup-julia@19bd4db8c427e07d56602f1c432e1a26a55d6735 # v1.8.2 | ||
with: | ||
version: 1 | ||
- shell: julia --color=yes {0} | ||
- run: | | ||
using Pkg | ||
Pkg.add(PackageSpec(name="JuliaFormatter", version="1.0.10")) | ||
using JuliaFormatter | ||
format(".", MinimalStyle(); normalize_line_endings = "unix") | ||
- uses: reviewdog/action-suggester@v1 | ||
Moelf marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the annotations left by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They don't pollute file changes more than the original PR, in the ideal case it pushes to the PR branch Failing a formatting test is a step in wrong direction, now you have something that PR author needs to download and setup in order to make PR, super annoying There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PRs with many comments, like for example #43990, would become even more unwieldy though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. which is why I always wanted it to be directly pushing to fork branch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean idk, it seems people think nothing is better than anything so maybe I will just drop this |
||
with: | ||
tool_name: JuliaFormatter | ||
fail_on_error: true | ||
filter_mode: added |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/pre-commit/mirrors-clang-format | ||
rev: v15.0.0 | ||
hooks: | ||
- id: clang-format | ||
types_or: [c++, c] |
Uh oh!
There was an error while loading. Please reload this page.