Skip to content
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

refactor(ast)!: no unneccesary trailing underscores on AstBuilder method names #8283

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Jan 6, 2025

AstBuilder method names have an _ added on end if method name is not a valid identifier (e.g. super). But no need for trailing underscore on alloc_super.

Currently this only applies to super. But future-proof by checking against all Rust's reserved words.

This is a breaking change, because alloc_super method was previously called alloc_super_. But probably no-one uses that method anyway - usually you'd use expression_super method to get an Expression::Super.

@github-actions github-actions bot added A-ast Area - AST A-ast-tools Area - AST tools C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jan 6, 2025
Copy link
Contributor Author

overlookmotel commented Jan 6, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

codspeed-hq bot commented Jan 6, 2025

CodSpeed Performance Report

Merging #8283 will not alter performance

Comparing 01-06-refactor_ast_no_unneccesary_trailing_underscores_on_astbuilder_method_names (d8b27af) with main (5106088)

Summary

✅ 29 untouched benchmarks

@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Jan 6, 2025
Copy link
Member

Dunqing commented Jan 6, 2025

Merge activity

  • Jan 6, 9:54 AM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 6, 9:54 AM EST: A user added this pull request to the Graphite merge queue.
  • Jan 6, 10:17 AM EST: A user merged this pull request with the Graphite merge queue.

…ethod names (#8283)

`AstBuilder` method names have an `_` added on end if method name is not a valid identifier (e.g. `super`). But no need for trailing underscore on `alloc_super`.

Currently this only applies to `super`. But future-proof by checking against all Rust's reserved words.

This is a breaking change, because `alloc_super` method was previously called `alloc_super_`. But probably no-one uses that method anyway - usually you'd use `expression_super` method to get an `Expression::Super`.
@Dunqing Dunqing force-pushed the 01-04-refactor_ast_astbuilder_enum_builder_methods_use_alloc__methods branch from 9bd7cde to 0db2a22 Compare January 6, 2025 15:09
@Dunqing Dunqing force-pushed the 01-06-refactor_ast_no_unneccesary_trailing_underscores_on_astbuilder_method_names branch from 9c884f1 to d8b27af Compare January 6, 2025 15:09
Base automatically changed from 01-04-refactor_ast_astbuilder_enum_builder_methods_use_alloc__methods to main January 6, 2025 15:14
@graphite-app graphite-app bot merged commit d8b27af into main Jan 6, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 01-06-refactor_ast_no_unneccesary_trailing_underscores_on_astbuilder_method_names branch January 6, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-ast Area - AST A-ast-tools Area - AST tools C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants