Skip to content

Ignore control flow keywords in check-webkit-style function style check #47090

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
Jun 24, 2025

Conversation

danlliu
Copy link
Contributor

@danlliu danlliu commented Jun 23, 2025

b37e3c7

Ignore control flow keywords in check-webkit-style function style check
https://bugs.webkit.org/show_bug.cgi?id=294872
rdar://154136983

Reviewed by Yusuke Suzuki.

Sometimes, we get some nonsensical style errors such as:

> The parameter name ">" adds no information, so it should be removed.

on code such as

```
if (a.b()->c() >= d)
```

due to the style checker believing this is a function declaration. We
should just ignore any "functions" named `if`, `for`, or `while` when
style checking, which should avoid some of these silly "style errors"

* Tools/Scripts/webkitpy/style/checkers/cpp.py:
(detect_functions):

Canonical link: https://commits.webkit.org/296581@main

a51573d

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 webkitpy ✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@danlliu danlliu self-assigned this Jun 23, 2025
@danlliu danlliu added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Jun 23, 2025
@danlliu danlliu added the merge-queue Applied to send a pull request to merge-queue label Jun 24, 2025
https://bugs.webkit.org/show_bug.cgi?id=294872
rdar://154136983

Reviewed by Yusuke Suzuki.

Sometimes, we get some nonsensical style errors such as:

> The parameter name ">" adds no information, so it should be removed.

on code such as

```
if (a.b()->c() >= d)
```

due to the style checker believing this is a function declaration. We
should just ignore any "functions" named `if`, `for`, or `while` when
style checking, which should avoid some of these silly "style errors"

* Tools/Scripts/webkitpy/style/checkers/cpp.py:
(detect_functions):

Canonical link: https://commits.webkit.org/296581@main
@webkit-commit-queue
Copy link
Collaborator

Committed 296581@main (b37e3c7): https://commits.webkit.org/296581@main

Reviewed commits have been landed. Closing PR #47090 and removing active labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Bugs Unclassified bugs are placed in this component until the correct component can be determined.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants