-
Notifications
You must be signed in to change notification settings - Fork 5
Add pre-commit code checks #145
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
5922ab1
Add pre-commit code checks
termi-official b036224
Try to fix
termi-official f215171
Merge branch 'main' into do/precommit-check
termi-official 52f0196
Add config
termi-official 8591676
Remove self-qualification
termi-official e4a9296
Cleanup some used function from packages.
termi-official a8db034
Fine tuning
termi-official aa3e2de
Update codechecks
termi-official 46a071f
Apply formatter
termi-official d5f5a96
Add JuliaFormatter to CI
termi-official 15af184
Oopsie.
termi-official 5e75684
Format test
termi-official 754ef6b
Format extensions and be specific
termi-official 24aeb73
Fix EOF
termi-official 49b11f1
Fix trailing WS
termi-official 7e2fb53
Format test and Use correct function from ExplicitImports
termi-official 7cfcacd
Try to ignore some folders
termi-official bb156c3
Fix some faulty formatting actions
termi-official 72d6c59
More formatting
termi-official 8b61407
One more
termi-official b2ebd8e
Trying to fix formatter 1/N
termi-official 4373138
Disable explicit-imports as it chokes too much
termi-official 98c6241
Trying to fix formatter 2/N
termi-official 2efca38
Update deps
termi-official f427a8f
Delete dead stuff
termi-official File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| style = "sciml" | ||
| align_assignment = true | ||
| margin = 100 | ||
| remove_extra_newlines = false | ||
| whitespace_in_kwargs = true | ||
| whitespace_typedefs = true | ||
| ignore = ["bak/*", "benchmarks/*", "data/*", "docs/*"] |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Code checks | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: ["main"] | ||
|
|
||
| jobs: | ||
|
|
||
| pre-commit: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | ||
|
|
||
| format: | ||
| runs-on: ubuntu-latest | ||
| name: "JuliaFormatter.jl" | ||
| steps: | ||
| - uses: julia-actions/setup-julia@latest | ||
| with: | ||
| version: '1.12' | ||
|
|
||
| - uses: actions/checkout@v6 | ||
| - name: Install JuliaFormatter and format | ||
| # This will use the latest version by default but you can set the version like so: | ||
| # | ||
| # julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))' | ||
| run: | | ||
| julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter")); Pkg.Apps.add(PackageSpec(name="JuliaFormatter"))' | ||
| $HOME/.julia/bin/jlfmt --inplace -v . | ||
| - name: Format check | ||
| run: | | ||
| julia -e ' | ||
| out = Cmd(`git diff`) |> read |> String | ||
| if out == "" | ||
| exit(0) | ||
| else | ||
| @error "Some files have not been formatted !!!" | ||
| write(stdout, out) | ||
| exit(1) | ||
| end' |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| repos: | ||
| - repo: 'https://github.com/pre-commit/pre-commit-hooks' | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: check-added-large-files | ||
| - id: check-case-conflict | ||
| - id: check-toml | ||
| - id: check-yaml | ||
| - id: end-of-file-fixer | ||
| - id: mixed-line-ending | ||
| - id: trailing-whitespace |
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.