-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code formatting: JuliaFormatter (#2255)
* Add .JuliaFormatter.toml * Run JuliaFormatter * Remove some overly cautious formatter ignores * Run JuliaFormatter * Add Format GA workflow
- Loading branch information
Showing
65 changed files
with
1,527 additions
and
1,332 deletions.
There are no files selected for viewing
This file contains 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,25 @@ | ||
style="blue" | ||
format_markdown = true | ||
# TODO | ||
# We ignore these files because when formatting was first put in place they were being worked on. | ||
# These ignores should be removed once the relevant PRs are merged/closed. | ||
ignore = [ | ||
# https://github.com/TuringLang/Turing.jl/pull/2231/files | ||
"src/experimental/gibbs.jl", | ||
"src/mcmc/abstractmcmc.jl", | ||
"test/experimental/gibbs.jl", | ||
"test/test_utils/numerical_tests.jl", | ||
# https://github.com/TuringLang/Turing.jl/pull/2218/files | ||
"src/mcmc/Inference.jl", | ||
"test/mcmc/Inference.jl", | ||
# https://github.com/TuringLang/Turing.jl/pull/2068 | ||
"src/variational/VariationalInference.jl", | ||
"src/variational/advi.jl", | ||
"test/variational/advi.jl", | ||
"test/variational/optimisers.jl", | ||
# https://github.com/TuringLang/Turing.jl/pull/1887 | ||
"test/mcmc/Inference.jl", | ||
"test/mcmc/hmc.jl", | ||
"test/mcmc/sghmc.jl", | ||
"test/runtests.jl", | ||
] |
This file contains 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,38 @@ | ||
name: Format | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
merge_group: | ||
types: [checks_requested] | ||
|
||
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@v4 | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: 1 | ||
- name: Format code | ||
run: | | ||
using Pkg | ||
Pkg.add(; name="JuliaFormatter", uuid="98e50ef6-434e-11e9-1051-2b60c6c9e899") | ||
using JuliaFormatter | ||
format("."; verbose=true) | ||
shell: julia --color=yes {0} | ||
- uses: reviewdog/action-suggester@v1 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
tool_name: JuliaFormatter | ||
fail_on_error: true |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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 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 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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
using DelimitedFiles | ||
|
||
function readlrdata() | ||
|
||
fname = joinpath(dirname(@__FILE__), "lr_nuts.data") | ||
z = readdlm(fname) | ||
x = z[:,1:end-1] | ||
y = z[:,end] .- 1 | ||
x = z[:, 1:(end - 1)] | ||
y = z[:, end] .- 1 | ||
return x, y | ||
end |
This file contains 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Turing's documentation in this directory is in markdown format. | ||
Turing's documentation in this directory is in markdown format. | ||
|
||
If you want to build the doc locally, please refer to the [README](https://github.com/TuringLang/turinglang.github.io) file in [turinglang.github.io](https://github.com/TuringLang/turinglang.github.io). | ||
|
||
Please also visit [this repo](https://github.com/TuringLang/TuringTutorials/tree/master/tutorials) for the docs. | ||
Please also visit [this repo](https://github.com/TuringLang/TuringTutorials/tree/master/tutorials) for the docs. |
This file contains 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 |
---|---|---|
|
@@ -22,4 +22,4 @@ Order = [:function] | |
```@autodocs | ||
Modules = [AdvancedHMC] | ||
Order = [:type] | ||
``` | ||
``` |
This file contains 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 |
---|---|---|
|
@@ -7,6 +7,7 @@ toc: true | |
```@meta | ||
CurrentModule = Turing | ||
``` | ||
|
||
## Index | ||
|
||
```@index | ||
|
This file contains 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 |
---|---|---|
|
@@ -22,4 +22,4 @@ Order = [:function] | |
```@autodocs | ||
Modules = [Bijectors] | ||
Order = [:type] | ||
``` | ||
``` |
Oops, something went wrong.