-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from Klafyvel/code-analysis
WIP: Code analysis
- Loading branch information
Showing
54 changed files
with
3,053 additions
and
1,881 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 |
---|---|---|
@@ -1,3 +1 @@ | ||
style = "sciml" | ||
format_docstrings = true | ||
margin = 80 | ||
style = "blue" |
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,15 @@ | ||
JULIA=$(shell which julia) | ||
TEST_PROCEDURE="import Pkg;Pkg.test()" | ||
|
||
format: | ||
$(JULIA) format_project.jl | ||
|
||
test%: | ||
$(JULIA) $* --project -e $(TEST_PROCEDURE) 2&> test-$*.log | ||
|
||
testall: test+lts test+beta test+release | ||
|
||
clean: | ||
rm test*.log | ||
|
||
.PHONY: format, test, testall, clean |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module TimeZonesExt | ||
using Dates, TimeZones, Norg | ||
|
||
@static if VERSION ≥ v"1.9" | ||
Norg.HAS_TIMEZONES_CAPABILITIES = true | ||
end | ||
|
||
function parse_timezone(::Val{:extension}, w) | ||
timezone = nothing | ||
try | ||
timezone = TimeZone(w) | ||
catch e | ||
if e isa ArgumentError | ||
@warn "Unable to process timezone" w | ||
else | ||
rethrow(e) | ||
end | ||
end | ||
return timezone | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Pkg: Pkg | ||
Pkg.add("JuliaFormatter") | ||
using TOML, JuliaFormatter | ||
format(".") | ||
projecttoml = TOML.parsefile("Project.toml") | ||
const _project_key_order = [ | ||
"name", | ||
"uuid", | ||
"keywords", | ||
"license", | ||
"desc", | ||
"deps", | ||
"weakdeps", | ||
"extensions", | ||
"compat", | ||
"extras", | ||
"targets", | ||
] | ||
function project_key_order(key::String) | ||
return something( | ||
findfirst(x -> x == key, _project_key_order), length(_project_key_order) + 1 | ||
) | ||
end | ||
|
||
function print_project(io, dict) | ||
return TOML.print(io, dict; sorted=true, by=key -> (project_key_order(key), key)) | ||
end | ||
|
||
open("Project.toml", "w") do io | ||
@info "whoh" io | ||
write(io, sprint(print_project, projecttoml)) | ||
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
Oops, something went wrong.