Skip to content

Separate grouped and ungrouped nodes more clearly in AST generator - #15646

Merged
dcreager merged 1 commit into
mainfrom
dcreager/grouped-nodes
Jan 21, 2025
Merged

Separate grouped and ungrouped nodes more clearly in AST generator#15646
dcreager merged 1 commit into
mainfrom
dcreager/grouped-nodes

Conversation

@dcreager

Copy link
Copy Markdown
Member

This is a minor cleanup to the AST generation script to make a clearer separation between nodes that do appear in a group enum, and those that don't. There are some types and methods that we create for every syntax node, and others that refer to the group that the syntax node belongs to, and which therefore don't make sense for ungrouped nodes. This new separation makes it clearer which category each definition is in, since you're either inside of a for group in ast.groups loop, or a for node in ast.all_nodes loop.

This is a minor cleanup to the AST generation script to make a clearer
separation between nodes that do appear in a group enum, and those that
don't.  There are some types and methods that we create for every
syntax node, and others that refer to the group that the syntax node
belongs to, and which therefore don't make sense for ungrouped nodes.
This new separation makes it clearer which category each definition is
in, since you're either inside of a `for group in ast.groups` loop, or a
`for node in ast.all_nodes` loop.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are changes in this file because a few definitions moved around, but their content did not change

@github-actions

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@MichaReiser MichaReiser added the internal An internal refactor or improvement label Jan 21, 2025
@dcreager
dcreager merged commit fa546b2 into main Jan 21, 2025
@dcreager
dcreager deleted the dcreager/grouped-nodes branch January 21, 2025 18:37
dcreager added a commit that referenced this pull request Jan 21, 2025
* main:
  Separate grouped and ungrouped nodes more clearly in AST generator (#15646)
  [`flake8-simplify`] Mark fixes as unsafe (`SIM201`, `SIM202`) (#15626)
  [red-knot] mdtest runner: include stderr for crashing tests (#15644)
  Change `EnvironmentOptions::venv-path` to `Option<SystemPathBuf>` (#15631)
  [`flake8-type-checking`] Fix some safe fixes being labeled unsafe (#15638)
  feat: Update RUF055 to do var == value (#15605)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants