Skip to content

Commit 528e399

Browse files
committed
feat: lint_module_file
1 parent a4cd67b commit 528e399

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/lint-api.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,20 @@ function lint_file(filepath::AbstractString, root = nothing, server = SymbolServ
3131
return file
3232
end
3333

34+
export lint_module_file
35+
function lint_module_file(filepath::AbstractString, root = nothing, server = nothing)
36+
37+
# Check extention
38+
if !isjuliafile(filepath)
39+
error("$filepath is not a julia file.")
40+
end
41+
42+
# read
43+
str = Base.read(filepath, String)
44+
45+
# parse_code
46+
cst = CSTParser.parse_code(str)
47+
48+
# File
49+
return StaticLint.File(filepath, str, cst, root, server)
50+
end

0 commit comments

Comments
 (0)