Skip to content

Commit

Permalink
add support for ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
Bennet-Sunder committed Apr 18, 2024
1 parent 715fca9 commit b03a051
Show file tree
Hide file tree
Showing 45 changed files with 2,292 additions and 6 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ tree-sitter-java = "0.20.2"
# TODO: Update after: https://github.com/alex-pinkus/tree-sitter-swift/issues/278 resolves
tree-sitter-swift = { git = "https://github.com/satyam1749/tree-sitter-swift.git", rev = "08a28993599f1968bc81631a89690503e1db7704" }
tree-sitter-python = "0.20.2"
tree-sitter-ruby = "0.20.1"
tree-sitter-typescript = "0.20.1"
# TODO: Update after https://github.com/tree-sitter/tree-sitter-go/pull/103 lands
tree-sitter-go = { git = "https://github.com/uber/tree-sitter-go.git", rev = "f8cffd0af7baaf7bf6062e403efe7c0d06319c41" }
Expand Down
50 changes: 50 additions & 0 deletions src/cleanup_rules/ruby/edges.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[[edges]]
scope = "Parent"
from = "replace_expression_with_boolean_literal"
to = ["boolean_literal_cleanup"]


[[edges]]
scope = "Parent"
from = "boolean_literal_cleanup"
to = ["boolean_expression_simplify", "statement_cleanup", "block_removal"]

[[edges]]
scope = "Parent"
from = "boolean_expression_simplify"
to = ["boolean_literal_cleanup"]

[[edges]]
scope = "Parent"
from = "statement_cleanup"
to = ["if_cleanup"]

[[edges]]
scope = "Parent"
from = "if_cleanup"
to = ["delete_all_statements_after_return"]

[[edges]]
scope = "Parent"
from = "delete_all_statements_after_return"
to = ["delete_all_statements_after_return"]

[[edges]]
scope = "Parent"
from = "statement_cleanup"
to = ["delete_variable_declaration"]

[[edges]]
scope = "Method"
from = "delete_variable_declaration"
to = ["replace_identifier_with_value"]

[[edges]]
scope = "Parent"
from = "replace_identifier_with_value"
to = ["boolean_literal_cleanup"]

[[edges]]
scope = "Parent"
from = "delete_variable_declaration"
to = ["identify_empty_methods"]

0 comments on commit b03a051

Please sign in to comment.