-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add static_link and aqua verifications.
- Loading branch information
1 parent
3c5d366
commit f2f81fb
Showing
40 changed files
with
939 additions
and
907 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
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,6 +1,18 @@ | ||
using Pkg | ||
|
||
for pkg in ("Coverage", "Documenter", "JET", "JuliaFormatter", "Logging", "LoggingExtras", "SnoopCompile") | ||
for pkg in ( | ||
"Aqua", | ||
"Coverage", | ||
"Documenter", | ||
"JET", | ||
"JuliaFormatter", | ||
"LanguageServer", | ||
"Logging", | ||
"LoggingExtras", | ||
"SnoopCompile", | ||
"StaticLint", | ||
"SymbolServer", | ||
) | ||
println("Adding $(pkg):") | ||
Pkg.add(pkg) | ||
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,6 @@ | ||
push!(LOAD_PATH, ".") | ||
|
||
using Aqua | ||
using Daf | ||
Aqua.test_ambiguities([Daf]) | ||
Aqua.test_all(Daf; ambiguities = false, unbound_args = false, deps_compat = false) |
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,2 @@ | ||
#!/bin/bash | ||
julia deps/aqua.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,74 @@ | ||
using LanguageServer | ||
using StaticLint | ||
using SymbolServer | ||
|
||
language_server = LanguageServerInstance(Pipe(), stdout, ".") | ||
_, symbols = SymbolServer.getstore(language_server.symbol_server, ".") | ||
language_server.global_env.symbols = symbols | ||
language_server.global_env.extended_methods = SymbolServer.collect_extended_methods(language_server.global_env.symbols) | ||
language_server.global_env.project_deps = collect(keys(language_server.global_env.symbols)) | ||
|
||
file = StaticLint.loadfile(language_server, abspath("src/Daf.jl")) | ||
StaticLint.semantic_pass(LanguageServer.getroot(file)) | ||
|
||
global errors = 0 | ||
global skipped = 0 | ||
global unused = 0 | ||
for doc in LanguageServer.getdocuments_value(language_server) | ||
StaticLint.check_all( | ||
LanguageServer.getcst(doc), | ||
language_server.lint_options, | ||
LanguageServer.getenv(doc, language_server), | ||
) | ||
LanguageServer.mark_errors(doc, doc.diagnostics) | ||
no_lint_lines = Set{Int}() | ||
unused_no_lint_lines = Set{Int}() | ||
for (line_number, line_text) in enumerate(readlines(doc._path)) | ||
if contains(line_text, "NOLINT") | ||
push!(no_lint_lines, line_number) | ||
push!(unused_no_lint_lines, line_number) | ||
end | ||
end | ||
for diagnostic in doc.diagnostics | ||
line_number = diagnostic.range.start.line + 1 | ||
character_number = diagnostic.range.start.character + 1 | ||
if line_number in no_lint_lines | ||
delete!(unused_no_lint_lines, line_number) | ||
global skipped | ||
skipped += 1 | ||
else | ||
println("$(doc._path):$(line_number):$(character_number): $(diagnostic.message)") | ||
global errors | ||
errors += 1 | ||
end | ||
end | ||
for line_number in sort(collect(unused_no_lint_lines)) | ||
global unused | ||
unused += 1 | ||
println("$(doc._path):$(line_number): unused NOLINT directive)") | ||
end | ||
end | ||
|
||
message = "StaticLint:" | ||
separator = "" | ||
if errors > 0 | ||
message *= " $(errors) errors" | ||
separator = "," | ||
end | ||
if skipped > 0 | ||
message *= "$(separator) $(skipped) skipped" | ||
separator = "," | ||
end | ||
if unused > 0 | ||
message *= "$(separator) $(unused) unused" | ||
end | ||
|
||
if errors + skipped + unused > 0 | ||
println(message) | ||
else | ||
println("StaticLint: clean!") | ||
end | ||
|
||
if errors + unused > 0 | ||
exit(1) | ||
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,3 @@ | ||
#!/bin/bash | ||
set -e -o pipefail | ||
julia deps/static_analysis.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 |
---|---|---|
@@ -1 +1 @@ | ||
{"documenter":{"julia_version":"1.10.2","generation_timestamp":"2024-04-04T20:19:23","documenter_version":"1.3.0"}} | ||
{"documenter":{"julia_version":"1.10.2","generation_timestamp":"2024-04-06T13:17:46","documenter_version":"1.3.0"}} |
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.