Skip to content

[libSyntax] Small improvements #60196

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 2 commits into from
Jul 24, 2022

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 22, 2022

  • Move error function to standalone Utils.py because that function really doesn’t belong in Node.py
  • In ParsedSyntaxBuilders child_elt_name was inferred from the last iteration of the loop above, which was incorrect.

@ahoppen ahoppen requested a review from rintaro July 22, 2022 15:22
@ahoppen
Copy link
Member Author

ahoppen commented Jul 22, 2022

@swift-ci Please smoke test

@rintaro
Copy link
Member

rintaro commented Jul 22, 2022

./utils/gyb_syntax_support/Utils.py:3:1: E302 expected 2 blank lines, found 1
./utils/gyb_syntax_support/Node.py:1:1: F401 'sys' imported but unused
./utils/gyb_syntax_support/Node.py:5:1: I100 Import statements are in the wrong order. 'from .Utils import error' should be before 'from .kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word'
./utils/gyb_syntax_support/Node.py:5:1: I202 Additional newline in a group of imports. 'from .Utils import error' is identified as Application Relative and 'from .kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word' is identified as Application Relative.
./utils/gyb_syntax_support/Node.py:9:1: E303 too many blank lines (3)

@rintaro
Copy link
Member

rintaro commented Jul 22, 2022

In ParsedSyntaxBuilders child_elt_name was inferred from the last iteration of the loop above, which was incorrect.

Good catch! I don't like Python's name scope...

Copy link
Member

@rintaro rintaro left a comment

Choose a reason for hiding this comment

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

LGTM after fixing the python-lint

ahoppen added 2 commits July 23, 2022 09:28
`child_elt_name` was inferred from the last iteration of the loop above, which was incorrect.
@ahoppen ahoppen force-pushed the pr/misc-libsyntax-improvements branch from d1ce55a to 38278e5 Compare July 23, 2022 07:28
@ahoppen
Copy link
Member Author

ahoppen commented Jul 23, 2022

@swift-ci Please smoke test

@ahoppen ahoppen merged commit 5494161 into swiftlang:main Jul 24, 2022
@ahoppen ahoppen deleted the pr/misc-libsyntax-improvements branch July 24, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants