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

Rename the "RedundantParentheses" rule to "ControlFlowParentheses" #25390

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

DanilaFe
Copy link
Contributor

@DanilaFe DanilaFe commented Jun 28, 2024

Per @bradcray's suggestion.

The RedundantParentheses rule (on main) refers to the rule that rejects parentheses around conditionals of control flow. Thus:

// bad
if (expr) {

}

// good
if expr {

}

However, Brad points out that the name "redundant parentheses" brings forth cases like ((expr)), where there are two sets of parentheses. Brad's thought -- with which I agree -- is that we should leave "redundant parentheses" for the hypothetical ((expr)) rule, and change the current rule for parentheses in ifs and loops to be "control flow parentheses".

Reviewed by @jabraham17 -- thanks!

Testing

  • test/chplcheck

@DanilaFe DanilaFe force-pushed the rename-redundant-parens branch from c7cbba6 to 7a3c887 Compare June 29, 2024 00:04
Copy link
Member

@jabraham17 jabraham17 left a comment

Choose a reason for hiding this comment

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

Looks good, but please add more context to the PR message before merging

@DanilaFe DanilaFe merged commit 25d23b6 into chapel-lang:main Jul 1, 2024
8 checks passed
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