Skip to content

Bump syntax_tree from 5.3.0 to 6.0.0 #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 13, 2023

Bumps syntax_tree from 5.3.0 to 6.0.0.

Changelog

Sourced from syntax_tree's changelog.

[6.0.0] - 2023-02-10

Added

  • SyntaxTree::BasicVisitor::visit_methods has been added to allow you to check multiple visit methods inside of a block. There was a method called visit_methods previously, but it was undocumented because it was meant as a private API. That method has been renamed to valid_visit_methods.
  • rake sorbet:rbi has been added as a task within the repository to generate an RBI file corresponding to the nodes in the tree. This can be used to help aid consumers of Syntax Tree that are using Sorbet.
  • SyntaxTree::Reflection has been added to allow you to get information about the nodes in the tree. It is not required by default, since it takes a small amount of time to parse node.rb and get all of the information.
  • SyntaxTree::Node#to_mermaid has been added to allow you to generate a Mermaid diagram of the node and its children. This is useful for debugging and understanding the structure of the tree.
  • SyntaxTree::Translation has been added as an experimental API to transform the Syntax Tree syntax tree into the syntax trees represented by the whitequark/parser and rubocop/rubocop-ast gems.
    • SyntaxTree::Translation.to_parser(node, buffer) will return a Parser::AST::Node object.
    • SyntaxTree::Translation.to_rubocop_ast(node, buffer) will return a RuboCop::AST::Node object.
  • SyntaxTree::index and SyntaxTree::index_file have been added to allow you to get a list of all of the classes, modules, and methods defined in a given source string or file.
  • Various convenience methods have been added:
    • SyntaxTree::format_file - which calls format with the result of reading the file
    • SyntaxTree::format_node - which formats the node directly
    • SyntaxTree::parse_file - which calls parse with the result of reading the file
    • SyntaxTree::search_file - which calls search with the result of reading the file
    • SyntaxTree::Node#start_char - which is the same as calling node.location.start_char
    • SyntaxTree::Node#end_char - which is the same as calling node.location.end_char
  • SyntaxTree::Assoc nodes can now be formatted on their own without a parent hash node.
  • SyntaxTree::BlockVar#arg0? has been added to check if a single required block parameter is present and would potentially be expanded.
  • More experimental APIs have been added to the SyntaxTree::YARV module, including:
    • SyntaxTree::YARV::ControlFlowGraph
    • SyntaxTree::YARV::DataFlowGraph
    • SyntaxTree::YARV::SeaOfNodes

Changed

Major changes

  • BREAKING Updates to WithEnvironment:
    • The WithEnvironment module has been renamed to WithScope.
    • The current_environment method has been renamed to current_scope.
    • The with_current_environment method has been removed.
    • Previously scopes were always able to look up the tree, as in: a = 1; def foo; a = 2; end would see only a single a variable. That has been corrected.
    • Previously accessing variables from inside of blocks that were not shadowed would mark them as being local to the block only. This has been correct.
  • BREAKING Lots of constants moved out of SyntaxTree::Visitor to just SyntaxTree:
    • SyntaxTree::Visitor::FieldVisitor is now SyntaxTree::FieldVisitor
    • SyntaxTree::Visitor::JSONVisitor is now SyntaxTree::JSONVisitor
    • SyntaxTree::Visitor::MatchVisitor is now SyntaxTree::MatchVisitor
    • SyntaxTree::Visitor::MutationVisitor is now SyntaxTree::MutationVisitor
    • SyntaxTree::Visitor::PrettyPrintVisitor is now SyntaxTree::PrettyPrintVisitor
  • BREAKING Lots of constants are now autoloaded instead of required by default. This is only particularly relevant if you are in a forking environment and want to preload constants before forking for better memory usage with copy-on-write.
  • BREAKING The SyntaxTree::Statements#initialize method no longer accepts a parser as the first argument. It now mirrors the other nodes in that it accepts its children and location. As a result, Syntax Tree nodes are now marshalable (and therefore can be sent over DRb). Previously the Statements node was not able to be marshaled because it held a reference to the parser.

Minor changes

  • Many places where embedded documents (=begin to =end) were being treated as real comments have been fixed for formatting.
  • Dynamic symbols in keyword pattern matching now have better formatting.
  • Endless method definitions used to have a SyntaxTree::BodyStmt node that had any kind of node as its statements field. That has been corrected to be more consistent such that now going from def_node.bodystmt.statements always returns a SyntaxTree::Statements node, which is more consistent.

... (truncated)

Commits
  • 4dac90b Bump to version 6.0.0
  • cfc2979 Remove unused sections of rubocop config
  • 575ae3e No submodules needed
  • 0068978 Pinned variables should be treated as usages, not definitions
  • 7419218 Merge pull request #309 from ruby-syntax-tree/updates
  • 4a6fc77 WithEnvironment -> WithScope
  • 174cc6b Make environment break at boundaries
  • 1a20231 Use visit_methods {}
  • 0dd0276 More utility functions
  • 0cf3e85 Autoload a bunch of stuff
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [syntax_tree](https://github.com/kddnewton/syntax_tree) from 5.3.0 to 6.0.0.
- [Release notes](https://github.com/kddnewton/syntax_tree/releases)
- [Changelog](https://github.com/ruby-syntax-tree/syntax_tree/blob/main/CHANGELOG.md)
- [Commits](ruby-syntax-tree/syntax_tree@v5.3.0...v6.0.0)

---
updated-dependencies:
- dependency-name: syntax_tree
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Feb 13, 2023
@github-actions github-actions bot merged commit be51a89 into main Feb 13, 2023
@dependabot dependabot bot deleted the dependabot/bundler/syntax_tree-6.0.0 branch February 13, 2023 20:10
@davidwessman davidwessman mentioned this pull request Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants