Skip to content
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

Better GitHub Action workflow for JuliaFormatter #213

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Code style
name: Format suggestions

on:
pull_request:
Expand All @@ -7,4 +7,4 @@ jobs:
code-style:
runs-on: ubuntu-latest
steps:
- uses: tkf/julia-code-style-suggesters@v1
- uses: julia-actions/julia-format@v2
5 changes: 3 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
repolink = "https://github.com/JuliaTesting/Aqua.jl",
assets = ["assets/favicon.ico"],
),
authors = "Takafumi Arakaki",
authors = "Takafumi Arakaki",

Check warning on line 24 in docs/make.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: docs/make.jl:24:- authors = "Takafumi Arakaki", docs/make.jl:24:+ authors = "Takafumi Arakaki",

Check warning on line 24 in docs/make.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: docs/make.jl:24:- authors = "Takafumi Arakaki", docs/make.jl:24:+ authors = "Takafumi Arakaki",
)

deploydocs(; repo = "github.com/JuliaTesting/Aqua.jl", push_preview = true)
deploydocs( ; repo = "github.com/JuliaTesting/Aqua.jl", push_preview = true)

Check warning on line 27 in docs/make.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: docs/make.jl:27:-deploydocs( ; repo = "github.com/JuliaTesting/Aqua.jl", push_preview = true) docs/make.jl:28:- docs/make.jl:27:+deploydocs(; repo = "github.com/JuliaTesting/Aqua.jl", push_preview = true)

Check warning on line 27 in docs/make.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: docs/make.jl:27:-deploydocs( ; repo = "github.com/JuliaTesting/Aqua.jl", push_preview = true) docs/make.jl:28:- docs/make.jl:27:+deploydocs(; repo = "github.com/JuliaTesting/Aqua.jl", push_preview = true)

15 changes: 8 additions & 7 deletions src/unbound_args.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
function test_unbound_args(m::Module; broken::Bool = false)
unbounds = detect_unbound_args_recursively(m)
if !isempty(unbounds)
printstyled(
stderr,
"Unbound type parameters detected:\n";
bold = true,
color = Base.error_color(),
printstyled(

Check warning on line 16 in src/unbound_args.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: src/unbound_args.jl:16:- printstyled( src/unbound_args.jl:17:- stderr, src/unbound_args.jl:18:- "Unbound type parameters detected:\n"; src/unbound_args.jl:19:- bold = true, src/unbound_args.jl:20:- color = Base.error_color(), src/unbound_args.jl:16:+ printstyled( src/unbound_args.jl:17:+ stderr, src/unbound_args.jl:18:+ "Unbound type parameters detected:\n"; src/unbound_args.jl:19:+ bold = true, src/unbound_args.jl:20:+ color = Base.error_color(),

Check warning on line 16 in src/unbound_args.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: src/unbound_args.jl:16:- printstyled( src/unbound_args.jl:17:- stderr, src/unbound_args.jl:18:- "Unbound type parameters detected:\n"; src/unbound_args.jl:19:- bold = true, src/unbound_args.jl:20:- color = Base.error_color(), src/unbound_args.jl:16:+ printstyled( src/unbound_args.jl:17:+ stderr, src/unbound_args.jl:18:+ "Unbound type parameters detected:\n"; src/unbound_args.jl:19:+ bold = true, src/unbound_args.jl:20:+ color = Base.error_color(),
stderr,
"Unbound type parameters detected:\n";
bold = true,
color = Base.error_color(),
)
show(stderr, MIME"text/plain"(), unbounds)
show(stderr,MIME"text/plain"( ) , unbounds)

Check warning on line 22 in src/unbound_args.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: src/unbound_args.jl:22:- show(stderr,MIME"text/plain"( ) , unbounds) src/unbound_args.jl:22:+ show(stderr, MIME"text/plain"(), unbounds)

Check warning on line 22 in src/unbound_args.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: src/unbound_args.jl:22:- show(stderr,MIME"text/plain"( ) , unbounds) src/unbound_args.jl:22:+ show(stderr, MIME"text/plain"(), unbounds)
println(stderr)
end
if broken
@test_broken isempty(unbounds)
@test_broken isempty(

Check warning on line 26 in src/unbound_args.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: src/unbound_args.jl:26:- @test_broken isempty( src/unbound_args.jl:27:- unbounds) src/unbound_args.jl:26:+ @test_broken isempty(unbounds)

Check warning on line 26 in src/unbound_args.jl

View check run for this annotation

Codecov / codecov/patch

src/unbound_args.jl#L26

Added line #L26 was not covered by tests

Check warning on line 26 in src/unbound_args.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: src/unbound_args.jl:26:- @test_broken isempty( src/unbound_args.jl:27:- unbounds) src/unbound_args.jl:26:+ @test_broken isempty(unbounds)
unbounds)
else
@test isempty(unbounds)
end
Expand Down
16 changes: 8 additions & 8 deletions test/test_unbound_args.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
using PkgUnboundArgs

@testset begin
results = @testtestset begin
Aqua.test_unbound_args(PkgUnboundArgs)
end
@test length(results) == 1
@test results[1] isa Test.Fail
results = @testtestset begin

Check warning on line 8 in test/test_unbound_args.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: test/test_unbound_args.jl:8:- results = @testtestset begin test/test_unbound_args.jl:9:- Aqua.test_unbound_args(PkgUnboundArgs) test/test_unbound_args.jl:10:- end test/test_unbound_args.jl:11:- @test length(results) == 1 test/test_unbound_args.jl:12:- @test results[1] isa Test.Fail test/test_unbound_args.jl:8:+ results = @testtestset begin test/test_unbound_args.jl:9:+ Aqua.test_unbound_args(PkgUnboundArgs) test/test_unbound_args.jl:10:+ end test/test_unbound_args.jl:11:+ @test length(results) == 1 test/test_unbound_args.jl:12:+ @test results[1] isa Test.Fail

Check warning on line 8 in test/test_unbound_args.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: test/test_unbound_args.jl:8:- results = @testtestset begin test/test_unbound_args.jl:9:- Aqua.test_unbound_args(PkgUnboundArgs) test/test_unbound_args.jl:10:- end test/test_unbound_args.jl:11:- @test length(results) == 1 test/test_unbound_args.jl:12:- @test results[1] isa Test.Fail test/test_unbound_args.jl:8:+ results = @testtestset begin test/test_unbound_args.jl:9:+ Aqua.test_unbound_args(PkgUnboundArgs) test/test_unbound_args.jl:10:+ end test/test_unbound_args.jl:11:+ @test length(results) == 1 test/test_unbound_args.jl:12:+ @test results[1] isa Test.Fail
Aqua.test_unbound_args(PkgUnboundArgs)
end
@test length(results) == 1
@test results[1] isa Test.Fail

# It works with other tests:
Aqua.test_ambiguities(PkgUnboundArgs)
Aqua.test_undefined_exports(PkgUnboundArgs)
# It works with other tests:

Check warning on line 14 in test/test_unbound_args.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: test/test_unbound_args.jl:14:- # It works with other tests: test/test_unbound_args.jl:15:- Aqua.test_ambiguities( PkgUnboundArgs ) test/test_unbound_args.jl:16:- Aqua.test_undefined_exports(PkgUnboundArgs) test/test_unbound_args.jl:14:+ # It works with other tests: test/test_unbound_args.jl:15:+ Aqua.test_ambiguities(PkgUnboundArgs) test/test_unbound_args.jl:16:+ Aqua.test_undefined_exports(PkgUnboundArgs)

Check warning on line 14 in test/test_unbound_args.jl

View workflow job for this annotation

GitHub Actions / code-style

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: test/test_unbound_args.jl:14:- # It works with other tests: test/test_unbound_args.jl:15:- Aqua.test_ambiguities( PkgUnboundArgs ) test/test_unbound_args.jl:16:- Aqua.test_undefined_exports(PkgUnboundArgs) test/test_unbound_args.jl:14:+ # It works with other tests: test/test_unbound_args.jl:15:+ Aqua.test_ambiguities(PkgUnboundArgs) test/test_unbound_args.jl:16:+ Aqua.test_undefined_exports(PkgUnboundArgs)
Aqua.test_ambiguities( PkgUnboundArgs )
Aqua.test_undefined_exports(PkgUnboundArgs)
end

end # module
Loading