-
Notifications
You must be signed in to change notification settings - Fork 428
formatter with Runic #1987
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
base: master
Are you sure you want to change the base?
formatter with Runic #1987
Conversation
I'd actually prefer Runic, it seems to work fine in StatsFuns and PDMats and I've been bitten by JuliaFormatter 2 problems a few times. GLM uses JuliaFormatter though, so there is no agreed on standard in JuliaStats yet. |
completely fine with me, I do not have preference |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1987 +/- ##
==========================================
- Coverage 86.28% 86.21% -0.08%
==========================================
Files 146 146
Lines 8787 8798 +11
==========================================
+ Hits 7582 7585 +3
- Misses 1205 1213 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The work is complete. Tests are passing. |
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.
Please remove this file and all other files in this folder. It has to be maintained and there is no reason for users to do anything else than following the Runic documentation.
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.
This won't work - this is referring to the commit in your fork but we have to ignore the commit that might finally land in the master branch. We have to add this file only once the formatting commit is in the master branch and its hash is known.
@@ -5,7 +5,7 @@ on: | |||
push: | |||
branches: | |||
- master | |||
tags: '*' | |||
tags: "*" |
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.
No need to change this?
tags: "*" | |
tags: '*' |
format: | ||
name: Format Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v2 | ||
with: | ||
version: "1" | ||
show-versioninfo: true | ||
- uses: julia-actions/cache@v2 | ||
- run: | | ||
julia --project=.formatting -e ' | ||
using Pkg | ||
Pkg.instantiate() | ||
include(".formatting/format_check.jl")' |
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.
We should keep it simple and just follow the recommended and documented workflow in the Runic docs:
format: | |
name: Format Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: "1" | |
show-versioninfo: true | |
- uses: julia-actions/cache@v2 | |
- run: | | |
julia --project=.formatting -e ' | |
using Pkg | |
Pkg.instantiate() | |
include(".formatting/format_check.jl")' | |
runic: | |
name: Runic formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: '1' | |
- uses: julia-actions/cache@v2 | |
- uses: fredrikekre/runic-action@v1 | |
with: | |
version: '1' |
Possibly it could be made a separate workflow as in e.g. PDMats (https://github.com/JuliaStats/PDMats.jl/blob/master/.github/workflows/Format.yml) but that doesn't matter too much IMO.
- "min" | ||
- "1" |
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.
No need to change these lines:
- "min" | |
- "1" | |
- 'min' | |
- '1' |
@@ -57,7 +72,7 @@ jobs: | |||
- uses: actions/checkout@v4 | |||
- uses: julia-actions/setup-julia@v2 | |||
with: | |||
version: '1' | |||
version: "1" |
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.
version: "1" | |
version: '1' |
To format the code, run the following command: | ||
```bash | ||
julia --project=.formatting -e 'using Pkg; Pkg.instantiate(); include(".formatting/format_all.jl")' | ||
``` | ||
|
||
**Note:** Code formatting is automatically checked in CI using Runic. | ||
The formatting command can be run locally with | ||
```julia | ||
julia --project=.formatting -e 'using Pkg; Pkg.instantiate(); include(".formatting/format_check.jl")' | ||
``` | ||
The `.git-blame-ignore-revs` file contains commit hashes for mass formatting changes. | ||
This allows `git blame` to show the actual authors of code changes rather than the formatting commit. | ||
When viewing blame information, use `git blame --ignore-revs-file .git-blame-ignore-revs <filename>`. | ||
|
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.
If we want to document it more prominently (not sure about it, users don't have to care and everyone who submits a PR will notice and learn it anyway), we should just refer to the Runic docs.
To format the code, run the following command: | |
```bash | |
julia --project=.formatting -e 'using Pkg; Pkg.instantiate(); include(".formatting/format_all.jl")' | |
``` | |
**Note:** Code formatting is automatically checked in CI using Runic. | |
The formatting command can be run locally with | |
```julia | |
julia --project=.formatting -e 'using Pkg; Pkg.instantiate(); include(".formatting/format_check.jl")' | |
``` | |
The `.git-blame-ignore-revs` file contains commit hashes for mass formatting changes. | |
This allows `git blame` to show the actual authors of code changes rather than the formatting commit. | |
When viewing blame information, use `git blame --ignore-revs-file .git-blame-ignore-revs <filename>`. |
Maybe let's merge #1905 before changing the formatting. |
Formatting cleanup using JuliaFormatter.format(".") to ensure consistent code style across the package. This reduces noisy diffs in future changes and improves readability. No functional changes.
Closes #1401
Modifications
.formating
with scripts.git-blame-ignore-revs
toTests