Skip to content

Commit

Permalink
Merge pull request #80 from RelationalAI/mm-frontcompiler-shape
Browse files Browse the repository at this point in the history
  • Loading branch information
gkastrinis authored Sep 27, 2024
2 parents 54719b4 + 28f0faf commit a0e10ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/linting/extended_checks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,7 @@ end
function check(t::NonFrontShapeAPIUsage_Extension, x::EXPR, markers::Dict{Symbol,String})
haskey(markers, :filename) || return
# In the front-end and in FFI, we are allowed to refer to `Shape`
contains(markers[:filename], "src/Compiler/Front") && return
contains(markers[:filename], "src/Compiler/front2back.jl") && return
contains(markers[:filename], "src/FrontCompiler") && return
contains(markers[:filename], "src/FFI") && return
contains(markers[:filename], "src/FrontIR") && return
# Also, allow usages in tests
Expand Down
2 changes: 1 addition & 1 deletion test/rai_rules_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,7 @@ end
"""

@test count_lint_errors(source; directory="/src/Execution") == 3
@test count_lint_errors(source; directory="/src/Compiler/Front") == 0
@test count_lint_errors(source; directory="/src/FrontCompiler") == 0

@test lint_test(source,
"Line 1, column 67: Usage of `Shape` is not allowed outside of the Front-end Compiler and FFI.";
Expand Down

0 comments on commit a0e10ed

Please sign in to comment.