-
Notifications
You must be signed in to change notification settings - Fork 83
Some tidying up #985
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
Some tidying up #985
Changes from all commits
c980765
eb0ef15
a5d2ea7
6decc40
137a475
d5e02e5
4f823a8
dcfaec9
bbabd1f
390cf8c
bcbb500
6695718
a962cfa
fb6e069
7daed4d
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,46 @@ | ||
| # This workflow tests that the pre-commit hook works as expected. | ||
|
Member
Author
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. Since I reverted the jlfmt pre-commit hook, we only have the 'old' hook to test, i.e. the one that calls |
||
| name: PreCommitHooks | ||
| on: | ||
| push: | ||
| tags: | ||
| - '*' | ||
| branches: | ||
| - 'master' | ||
| pull_request: | ||
| branches: | ||
| - 'master' | ||
|
|
||
| jobs: | ||
| pre-commit: | ||
| name: julia-formatter hook | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: julia-actions/setup-julia@v3 | ||
| with: | ||
| version: '1' | ||
|
|
||
| - name: Install checked out JuliaFormatter in global env | ||
| run: | | ||
| julia -e 'using Pkg; Pkg.add(; path=".")' | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.x' | ||
|
|
||
| - name: Test pre-commit hook | ||
| working-directory: .github/workflows/pre-commit | ||
| run: | | ||
| # Run pre-commit hook, check that it fails. | ||
| # pre-commit try-repo will fail if the hook makes changes | ||
| pipx run pre-commit try-repo ../../../ julia-formatter --files main.jl --verbose && exit 1 | ||
|
pfitzseb marked this conversation as resolved.
|
||
|
|
||
| # Check that the file was changed. | ||
| git diff --exit-code main.jl && exit 1 | ||
|
|
||
| # Check that running the hook again succeeds. | ||
| pipx run pre-commit try-repo ../../../ julia-formatter --files main.jl --verbose | ||
|
pfitzseb marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| function f(x ) | ||
| return x+1 | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| - id: julia-formatter | ||
| name: "Julia Formatter" | ||
| entry: "jlfmt --inplace" | ||
| entry: "julia -e 'import JuliaFormatter: format; format(ARGS)'" | ||
|
Member
Author
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. cf. #968. |
||
| pass_filenames: true | ||
| always_run: false | ||
| types: [file] | ||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@digital-carver I took this one from your PR, #984, if that's OK, I had to change it anyway and hopefully it'll make it easier to handle merge conflicts.